Tag Info

New answers tagged

1

Rather than hooking on phpmailer_init, why not just set $query['to'] = ''; and return $query; inside the wp_mail hook?


1

$post->post_author will return the ID of the post author, which you can then use with the WP_User object to retrieve the username and add to the outgoing email: if (get_option('jr_bcc_apply_emails')=='yes') : $author = new WP_User( $post->post_author ); $username = $author->user_login; $to = get_option('admin_email'); $subject = __('[copy] ...


0

This workaround is far from ideal, but it gets the job done. On $mail_sent == true set a post meta. In the __construct function add a callback to the admin_head action that checks whether the post meta has been set. If yes, delete the post meta and add the admin_notices action with the callback to the desired admin notice. class Send_mail { public ...


0

Attachments should always use the absolute filesystem path. Also to change the Content-Type of the email you should use the wp_mail_content_type filter. <?php function my_custom_email() { $to = 'my@email.com'; $subject = 'WordPress wp_mail'; $message = ' <html> <body> <table rules="all" style="border-color: ...



Top 50 recent answers are included