I’ve created this plugin in preparation to integration I’m planning to do with PHPMailer to a different plugin, but since it can be used independently, and I saw some people asking about a PHPMailer mail drivers I decided to upload this now.
This plugin adds 3 things
- kirby mail log driver - this will just log your emails into a file - I like it for developing.
- kirby mail phpmailer driver. send your emails through smtp
- kirby mail wrapper class - basically just turns the regular syntax to a fluent api - which I find more readable.
So this -
$email = email(array( 'to' => 'firstname.lastname@example.org', 'from' => 'email@example.com', 'subject' => 'Yay, Kirby sends mails', 'body' => 'Hey, this is a test email!' )); $email->send()
$mailer = new lcd344\Mailer('mail'); $mailer->to('firstname.lastname@example.org'); >from('email@example.com'); ->send('subject,'body');
updated the api a bit, I will also be next adding an optional panel page to mail users.
Version 1.0 has now been officially released. It includes a way to bind data and inject it into email body using mustaches.