gurucomkz / campaignmonitor-smtp-transport
This component provides SMTP transport for http://createsend.com service. Use it together with Swift_Mailer.
Installs: 30
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- php: >=5.4.0
- campaignmonitor/createsend-php: ^6.1
- swiftmailer/swiftmailer: ~5.0
This package is auto-updated.
Last update: 2024-12-16 13:55:19 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.