Here are a couple of things:
- You’re mixing ‘ and ” in a very bad way!
- You’re
echo
ing inside a string. Don’t do that. - You’re silencing any errors on the
wp_mail
function, so if WordPress is giving you an error you’ll never see it!
First, fix your ‘ and ” problem. Your $subject
definition should read like this:
$subject = "New Ticket in " . get_post_meta($pid, 'problem_type', true);
This fix also fixes the echo
problem.
Next, remove the @
from in front of wp_mail
and turn on WP_DEBUG in your config files so you can see any errors that crop up.
Related Posts:
- 3 different mail notifications
- How can I format email notification after registration?
- Does WordPress have a built in message function for presenting notifications to users?
- Remove Update Notification (for all users except ADMIN)
- Show Admin Message on Redirect
- If new comment posted in custom post – send notification to custom email from custom field
- How to send notifications without a plugin when a post is updated in WordPress?
- Email Post Attachment on wp_insert_post Action
- Email has been changed notifications
- How best to display notifications on the front-end using caught exceptions as an example
- Send notification to the admin when new custom post is submitted
- What are the pros and cons to a WordPress run newsletter v. third party newsletter? [closed]
- REST alert when new WordPress post is published or updated
- What is the most efficient way of implementing a notification system? [closed]
- Can I show a custom message to a specific user?
- send new post notification to an email address stored in a custom field value
- Removing sensitive information from comment notifications – notify_post_author
- Notification when certain posts are published
- Using wp_mail to send email?
- How to display Real-Time notifications (via Icons) in WordPress
- How to send automatic response after form submission without plugin
- WordPress, Mailchimp, Campaigns – should separate campaigns be used for something like notifying users of drip content?
- How can admins to be notified of changes when users change their WP profiles?
- New user notification issue
- Notification on getting an email from an user
- How to prevent comment moderation flood?
- Looking for plugins that notify users of comment replies [closed]
- Admin notice on wp_insert_post
- How to hide popping up Google Play’s unlocked achievement programatically?
- Send both HTML and Plain Text emails using wp_mail in wordpress
- How do I set a featured image (thumbnail) by image URL when using wp_insert_post()?
- Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
- Disable update notification for individual plugins
- Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
- Why won’t wp_mail() let me set the From: header when plain old PHP mail() will?
- How to update custom fields using the wp_insert_post() function?
- How to set SMTP programmatically
- What is the advantage of using wp_mail?
- Attaching taxonomy data to post with wp_insert_post
- Disable email notification after change of password
- Faster way to wp_insert_post & add_post_meta in bulk
- How to set featured image to custom post from outside programmatically
- Using wp_mail with attachments but no attachments received
- wordpress sanitize array?
- Proper formatting of post_date for wp_insert_post?
- How to set post slug when using wp_insert_post();?
- Check if Post Title exists, Insert post if doesn’t, Add Incremental # to Meta if does
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- Is there a downside of using wp_defer_term_counting?
- Alert Email when any Post or Page is Changed
- Do something after sending email
- wp_insert_post extremely slow on big table, direct query very fast
- What is “meta_input” parameter in wp_insert_post() used for?
- Enable update notification, disable updates
- wp_insert_post add meta_input
- Add update notification bubble to admin menu item?
- tax_input not working wp_insert_post
- Using wp_schedule_single_event with arguments to send email
- How to add headers to outgoing email?
- Define page template in wp_insert_post
- Using wp_insert_post() with Networking enabled
- wp set object terms vs wp set post terms
- Why is there both a save_post and wp_insert_post action?
- How to disable the “Your site has updated to WordPress x.y.z” admin email?
- How to change the email notification recipient (user) for new comments?
- How to send an email using wp_mail and using more than one BCC in the header
- See error message from wp_insert_post function?
- wp_mail and BCC headers
- WordPress “phpmailer_init” not working for me
- Disable WP core updates but send email notification
- New post notification in wp_nav_menu
- Pluggable function and activation check?
- Check to check if wp_mail is working properly?
- how to set from address according to the form input email address for wp_mail()?
- Multiple email recipient using wp_mail()
- Unable to prevent function using save_post firing twice
- Get post ID from wp_insert_post()
- Create posts on user registration
- Adding post thumbnail in programatically inserted post
- Overriding the default WP Multisite notification e-mail
- Customizing the Subject Field in WordPress’ Notification Emails?
- can’t edit post_modified in wp_insert_post (bug?)
- Issue with wp_insert_post and post_content field error Could not update post in the database
- Disable new user notification to admin email
- Using WordPress templating for HTML emails
- Send email when a new post is published [closed]
- WP insert post and custom taxonomy
- advanced custom fields update_field for field type: Taxonomy
- How do I override the Message-ID header of wp_mail function?
- Send attachments via wp_mail from temporary folder
- wp_insert_post incorrectly escapes HTML comments when they include tags
- Showing WP_Error message with admin_notice action hook
- wp_mail script with jQuery post
- wp_mail is undefined
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- How to apply the “retrieve_password_message” filter?
- How to count number of functions attached to an action hook?
- Running WP Cron on specific local time
- How to add notification bubble for my custom admin menu page
- wp_mail – Remove sitename from email subject