Here’s an (untested) PHPMailer example to check for e.g. the subject and the content type:
function mailer_config( PHPMailer $mailer ) {
if( 'Subject #1' === $mailer->Subject && 'text/html' !== $mailer->ContentType ) {
$mailer->IsHTML( true );
}
}
other options would be to e.g. check the $mailer->From
or $mailer->FromName
, or some other conditions, depending on your setup.
Another approach without PHPMailer dependency, could be to use the wp_mail
filter, with the wp_mail_content_type
filter.