New answers tagged

0

You don't need to pass the from name and email to PHPMailer in your code as it will take it from $headers so try the following: add_action( "phpmailer_init", "send_smtp_email" ); function send_smtp_email( $phpmailer ) { // ini_set("sendmail_from","xyz@gmail.com"); // ini_set("sendmail_path","xyz@gmail.com"); // Define that we are sending with SMTP ...


1

This is not really a WordPress bug at all, it is a phpmailer one in not allowing for custom headers... if you look at class-phpmailer.php: public function getMailMIME() { $result = ''; $ismultipart = true; switch ($this->message_type) { case 'inline': $result .= $this->headerLine('Content-Type', 'multipart/related;'); ...


0

So turns out that on Safari and Firefox, the page would refresh before the email got sent out. As a workaround I just created another button that the user has to click on before clicking on the actual button that updates their profile information. The click event handler on that first button is being used to send out the information to the php file now. It ...


2

There's a great article explaining how to hook into 2 filters for this at http://www.sourcexpress.com/customize-wordpress-comment-notification-emails/ To send your notifications to a particular user and not the site admin, try this for a user with ID 123: function se_comment_moderation_recipients( $emails, $comment_id ) { $comment = get_comment( ...


2

The default email content type is text/plain which does not allow using HTML. Add this to your functions.php file: // use HTML instead of plain text add_filter( 'wp_mail_content_type', 'my_awesome_mail_content_type' ); function my_awesome_mail_content_type() { return 'text/html'; } But be warned, different email clients has very different support ...


0

Try with this: function dddn_process($id) { // emails anyone on or above this level $email_user_level = 7; global $wpdb; $tp = $wpdb->prefix; $result = $wpdb->get_row(" SELECT post_status, post_title, user_login, user_nicename, display_name FROM {$tp}posts, {$tp}users WHERE {$tp}posts.post_author = ...


3

First of all, don't reInvent the wheel, it's a wastage of time, money - everything. If you want to stick with the WordPress' way, better be with a Custom Post Type. Create a custom post type for storing emails in its postmeta. Make a form, and save the values to the CPT's postmeta Make a Menu Page and do use the Settings API and make your email template ...


2

Im not aware of any hook that could change only comment notification recipient.. You would probably need to overwrite some kind of core function but here's a small workaround you could use: 1. Disable the email feature from WordPress comments settings (unless you want to get notified too) 2. Send it manually using comment_post action hook, just add this ...


0

Scroll down a little bit, most of it is WordPress default code but you must add everything to your plugin or you might break it! I've also added few useful snippets below. Copy-paste them to same plugin. <?php /* * Plugin Name: Emails * Plugin URI: http://www.your-site.com * Description: Different registration email for different roles * Author: ...



Top 50 recent answers are included