stolfam / mandrill
Easy-to-use PHP library for sending emails with Mandrill.
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/stolfam/mandrill
Requires
- php: >= 7.1.0
- mandrill/mandrill: ^1.0
README
Easy-to-use PHP library for sending emails with Mandrill.
Installation
composer require ataccama/mandrill
Usage
$mandrill = new Ataccama\MandrillMailer(API_KEY, SUB_ACCOUNT);
Send Mandrill template
$mandrill ->addFrom('email@address.com', 'Name') ->addTo('email@address.com') ->setSubject('Email subject') ->templateName('tmp-name');
Add variables to template
$mandrill->addAttributes([ 'variable_key_1' => 'variable 1 content', 'variable_key_2' => 'variable 2 content' ]);
Add attachments
addAttachment("filename.txt", "file content")
Send basic html email
$mandrill ->addFrom('email@address.com') ->addTo('email@address.com', 'Name') ->setSubject('Events confirmation') ->setHtmlBody('<h1>Love you</h1><p>Soo <strong>much</strong>!</p>');
Send
$mandrill->send();