How do I customise the new user welcome email

SB Welcome Email Editor works by replacing wp_new_user_notification() with an own version. The original version can be found in wp-includes/pluggable.php, the plugin uses an elaborate replacement with all kinds of options. You can do this to: create a new plugin (just a PHP file in wp-content/plugins/), and define wp_new_user_notification($user_id, $plaintext_pass=””) there. This will then be … Read more

Do something after sending email

Using the PHPMailer class with an action callback: I did some digging into the PHPMailer class and found that it supports a custom action. Here’s how the callback is activated with the doCallback() method in the class. There’s also a PHPMailer test on GitHub using this feature via the callbackAction() callback. We can set it … Read more

Disable user registration password email

You can intercept this email before it is sent using the phpmailer_init hook. By default, this hook fires before any email is sent. In the function below, $phpmailer will be an instance of PHPMailer, and you can use its methods to remove the default recipient and manipulate the email before it is sent. add_action(‘phpmailer_init’, ‘wse199274_intercept_registration_email’); … Read more

Sending multipart (text/html) emails via wp_mail() will likely get your domain banned

The following version of wp_mail() is with the patch applied of @rmccue/@MattyRob in the ticket https://core.trac.wordpress.org/ticket/15448, refreshed for 4.2.2, which allows $message to be an array containing content-type keyed alternates: /** * Send mail, similar to PHP’s mail * * A true return value does not automatically mean that the user received the * email … Read more

mailto link with HTML body

As you can see in RFC 6068, this is not possible at all: The special <hfname> “body” indicates that the associated <hfvalue> is the body of the message. The “body” field value is intended to contain the content for the first text/plain body part of the message. The “body” pseudo header field is primarily intended for the generation of short … Read more