LAPS Posted March 5, 2020 Posted March 5, 2020 Hi there, in ProcessWire I've installed two modules for sending emails: WireMail SMTP and WireMail Mailgun. I would like to use the WireMail Mailgun for sending an email just for a given case. When I use the following $mailer = WireMail(); $mailer->from('sender@email.com'); $mailer->to('receiver@email.com'); $mailer->subject('Testing Mailgun'); $mailer->body('Just testing.'); $mailer->send(); then the email is sent by the WireMail SMTP module. How can I send the email using WireMail Mailgun?
MoritzLost Posted March 5, 2020 Posted March 5, 2020 Use the function wireMail() or the $mail->new() to instantiate an E-Mail object, then ProcessWire will automatically look for other WireMail modules and instantiate one of them instead of the default WireMail object. You can also request a specific WireMail module by specifing it as an option. For example, for the Mailgun module, this should work: $mailgun = $mail->new(['module' => 'WireMailMailgun']); $mailgun instanceof WireMailMailgun; // true See the documentation for $mail->new(). 4 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now