mailer.prepareSend

Triggered in October\Rain\Mail\Mailer.

Fires before the mailer processes the sending action

Parameters:

  • $view: View code as a string
  • $message: Illuminate\Mail\Message object, check Swift_Mime_SimpleMessage for useful functions.

Example usage (stops the sending process):

Event::listen('mailer.prepareSend', function ((string) $view, (\Illuminate\Mail\Message) $message) {
    return false;
});

Or

$mailerInstance->bindEvent('mailer.prepareSend', function ((\October\Rain\Mail\Mailer) $mailerInstance, (string) $view, (\Illuminate\Mail\Message) $message) {
    return false;
});