gurucomkz/campaignmonitor-smtp-transport

This component provides SMTP transport for http://createsend.com service. Use it together with Swift_Mailer.

dev-master 2021-04-16 05:56 UTC

This package is auto-updated.

Last update: 2024-05-16 12:42:29 UTC


README

Install

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require --prefer-dist gurucomkz/campaignmonitor-smtp-transport "dev-master"

or add

"gurucomkz/campaignmonitor-smtp-transport": "dev-master"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code:

In configuration file

'components' => [
    'mailer' => [
        'class' => '\yii\swiftmailer\MailerMailer',
        'transport' => [
            'class' => '\gurucomkz\campaignmonitor\SmtpTransport',
            'mailgunDomain' => '<Domain Name>',
            'privateApiKey' => '<Private API Key>',
        ],
    ],

Sending images to Johny

\Yii::$app->mailer
    ->compose()
    ->setFrom('me@nomail.com')
    ->setTo('john.doe@nomail.com')
    ->setSubject('Message to Johny')
    ->setTextBody('Hello, Johny! Take a look at our party pics :)')
    ->attach('/image-1.jpeg')
    ->attach('/image-2.jpeg')
    ->send();

License

The BSD License (BSD). Please see License File for more information.