Send specific users an email when posts are published

Do you know if your wp_mail() function is working at all? Do you know whether or not your function isn’t failing higher in the chain? I’d re-write the function like this, which makes it a little easier to read and also slightly more efficient as we are only running functions that we absolutely need to … Read more

Processing a subscription form with POST method?

This solution is based on a couple of WPMU Dev plugins: PopUp Pro and Mailchimp Integration. If you are WPMU Dev member then download and install them either from their Project pages or via the WPMU Dev dashboard in your WordPress admin interface. Most of the effort is in creating a custom style for the … Read more

Do I have to override the wp_mail() pluggable function with writing a plugin?

Yes you need to use a plugin. Point is that pluggables are between hard and impossible to control. You can read through this thread on wp-hackers about the actual problems and why you shouldn’t use them. Important: Note: pluggable.php loads before the ‘plugins_loaded’ hook. This means that you need the “MU-plugins” (Must use) hook: mu_plugins_loaded … Read more

Can you set envelope sender used by wp_mail?

Yes. You can. There is several filters what you mentioned in your question. You can do it with WP Mail SMTP plugin. This plugin have multiple settings such as: Sender Name, Sender Email. To get it to set the envelope sender as well, you have to turn on the “Return Path” option. This stuff working … Read more

Send automatic emails to multiple user roles when a custom field is updated in a custom post type

This code will allow you to call a custom function when your meta key is updated. add_action(‘updated_postmeta’,’my_meta_update’, 10, 4); function my_meta_update( $meta_id, $object_id, $meta_key, $meta_value ) { if($meta_key === ‘my_meta_key’) { // trigger email(s) // wp_mail( $to, $subject, $message, $headers, $attachments ); } } Like Shaun mentioned, you should always use an external email solution … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)