Is there a way I can extend the mailer so when an email is sent by XenForo for any purpose (either before or after) for any purpose (i.e. password reset, watched thread, DM, activity summary, etc) I can access properties of the message (particularly, the subject).
Sorry for double post, but you are exactly correct, I'm starting to see which methods send mail directly; password reset being one of them. When extending the class for setContent, how do execute my setContent method after setContent happens? I'd prefer to not copy the code out of the Mail.php file into the setContent method of my class, then add the few lines I need thereafter.
public function setContent($subject, $htmlBody, $textBody = null): Mail
{
$mail = parent::setContent($subject, $htmlBody, $textBody);
// ... whatever you need to do
return $mail;
}
public function setContent($subject, $htmlBody, $textBody = null): Mail
{
$mail = parent::setContent($subject, $htmlBody, $textBody);
// ... whatever you need to do
return $mail;
}
You’d have to post the full approach you’re using, calling a parent method won’t result in an infinite loop. Virtually all method extensions in every add-on call the parent method (it’s important to do so for add-on interoperability).