Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 628 Bytes

readme.md

File metadata and controls

30 lines (22 loc) · 628 Bytes

Yii 2 extension for Resend

You need this library? just install it through composer

composer require yus-ham/yii2-resend --prefer-dist -o

Also don't forget to configure

$config['components']['mailer'] = [
    'class' => 'yusham\resend\Mailer',
    'useFileTransport' => false,
    'viewPath' => '@app/mail',
    'transport' => [
        'apiKey' => '<YOUR_API_KEY>'
    ],
];

And you can then send an email as usually

Yii::$app->mailer->compose('contact/html')
     ->setFrom('[email protected]')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->send();