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
- Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
- Why won’t wp_mail() let me set the From: header when plain old PHP mail() will?
- Do something after sending email
- wp_insert_post extremely slow on big table, direct query very fast
- Using wp_schedule_single_event with arguments to send email
- How to add headers to outgoing email?
- Define page template in wp_insert_post
- wp_mail script with jQuery post
- wp_mail is undefined
- How do I programmatically add items of content to a custom post type?
- Add image to post from external URL
- wp_insert_post breaks rewrite rules
- wp_mail not running inside Cron
- Plugin from WordPress.com for comment notification…available? [closed]
- wp_insert_post does not write my post_name
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- Can I edit the wp_post > post_content right before its inserted/updated?
- How to send email in wordpress with more than one attachments
- Conditionally set post_content in wp_insert_post
- Is it possible to create a post using a metabox?
- Simple plugins to post info about new blog entries?
- WP Cron is “half-failing” to insert posts
- Create Page With wp_insert_post() and AJAX
- Set default Custom Post Meta Value
- Using wp_schedule_event to send emails including links
- wp_insert_post issue
- How Can I Change Default Reply ToEmail
- Woocommerce get billing state manually
- Auto-Select Parent Category as Primary
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Trying to get author’email for sending email from single.php page in wordpress?
- Use of wp_insert_post and parameters
- Email user on WordPress upgrade
- Send multiple attachments with JQuery and wp_mail() function
- White screen when activating plugin that sends form via WordPress
- How dynamically change wp_mail behaviour, sending html or plain text based on conditions?
- Allow unfiltered HTML for not logged in users when saving a post
- Sending mails with wp_mail() to multiple recipients using wp_cron and dynamic email body data
- WordPress wp_mail function not working, returns false
- Is it possible to not receive email notifications for comments?
- WordPress hook which triggers on post import
- Adding a button to send email to a user in WordPress Admin Users table
- Send notification email to admin for every new post published
- Get Post ID after front end post submission
- wp_mail issue with sending PDF
- Create Post Using Form on WP Dashboard
- Individual Comment Notification Setting For Post Author
- Adding post date will not insert new post
- Save the Post ID from wp_insert_post($post); into a text file?
- Front end posting
- Deleting terms from the WordPress wp terms table
- Creating posts with links from a txt file
- Import JSON feed into WordPress Post (wp_insert_post) every 24 hours
- Add Server Side validation in Ajax mail form
- Posts form with AJAX request – Plugin development
- How do I find out which (page) template file my custom child post is looking for?
- Sanitize WordPress Array Input?
- wp_insert_post not adding taxonomy (using wp_set_object_terms)
- Allow user to add the php code in wp_mail()
- wp_insert_post inside save_post adds wrong metadata to inserted post
- wp_set_post_terms() seems very slow
- Filter wp_mail based on content type
- will wp_insert_post write a new custom field to the database?
- Is wp_mail plugin territory?
- Sending email with wp_email and AJAX
- Add a image to a post published on a CPT from the front-end
- Pay before posting (frontend insert post)
- automatic send email at custom time
- foreach $FILES create post how to
- Notification When Post Approved
- WP – not sending email