Requirements ¶
This extension needs
- Yii 2.0
- PostmarkApp account https://postmarkapp.com
Usage ¶
Add the extension to your composer.json
[javascript]
{
"require": {
"sweelix/yii2-postmark": "~1.0"
}
}
Add the extension to your configuration
return [
//....
'components' => [
'mailer' => [
'class' => 'sweelix\postmark\Mailer',
'token' => '<your postmark token>',
],
],
];
Send email as usual
// using postmark templates
Yii::$app->mailer->compose()
->setFrom('from@domain.com')
->setTo($form->email)
->setSubject($form->subject)
->setTemplateId(12345)
->setTemplateModel([
'firstname' => $form->firstname,
'lastname' => $form->lastname,
->send();
// using regular Yii template
Yii::$app->mailer->compose('contact/html')
->setFrom('from@domain.com')
->setTo($form->email)
->setSubject($form->subject)
->send();
Changes ¶
- Fix problem with charset
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.