SlideShare a Scribd company logo
Beginners Guide
to Mandrill
What Is Mandrill?
Mandrill is designed to help applications or
websites that need to send transactional email
like password resets, order confirmations,
notifications and welcome messages.
Technically, you can send any legal, non-spam
emails through Mandrill.
Points
 How to Get Started with Mandrill?
 SMTP Integration.
 Delivery and Authentication.
 API Integration.
 Inbound Email Processing.
 Webhooks.
 Reputation and Hourly Quota.
Get Started
Create a Mandrill Account
To get started, you'll want to create a new Mandrill account here:
http://mandrill.com/signup/
Set Up Sending Domains
Once you've SIGNED UP, one of the first things you'll want to do is set
up your sending domain(s).
• Sender Policy Framework (SPF) Record
• Domain Keys Identified Mail (DKIM) Record
SMTP Integration
Find our SMTP credentials on the SMTP & API Info in settings page.
The SMTP password is any active API key for your account, not the password
used to log in to Mandrill.
SPMTP Integration with PHP Mailer Class
$mail->Host = 'smtp.mandrillapp.com'; // Specify main and backup server
$mail->Port = 587; // Set the SMTP port
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'MANDRILL_USERNAME'; // SMTP username
$mail->Password = 'MANDRILL_APIKEY'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable
Email Delivery & Authentication
Email can be easy to forge, so Mandrill automatically authenticates all emails
sent through their system using multiple authentication methods to help
improve deliverability.
Set Up Sending Domains
Add SPF and DKIM records to our sending domains to remove the 'on behalf
of' or 'via' information.
1.Add new sending domain under settings.
2.Click the View DKIM Settings and View SPF Settings links for more detailed
information
3.Click the Test DNS Settings button to check and verify the DNS settings for
our sending domain.
API Integration
Mandrill has official API clients/wrappers for the following languages:
Ruby, Python, NodeJS, JavaScript and PHP.
Third-Party API Wrappers
There is a list of known Mandrill API wrappers created by third parties for
different languages. In php, we can use
•https://github.com/kai5263499/mandrill-php
•https://github.com/darrenscerri/Mindrill
•https://github.com/MichMich/laravel-mandrill (LaravelPHP)
API Endpoint
All API URLs are relative to
https://mandrillapp.com/api/1.0/.
For example, the /users/ping API call is reachable at
https://mandrillapp.com/api/1.0/users/ping.json.
Mandrill PHP API Integration
Requirements
PHP 5.2.x or higher
PHP cURL extension
Install via composer
 curl -s http://getcomposer.org/installer | php
 Create composer.json
 { "require": { "mandrill/mandrill": "1.0.*" } }
 Install dependency: php composer.phar install
Using the Library
Mandrill API start by including the library and instantiating the Mandrill class.
<?php
require_once 'mandrill-api-php/src/Mandrill.php'; //Not required with Composer
$mandrill = new Mandrill('YOUR_API_KEY');
?>
API Calls
Mandrill API calls are described in the following link
https://mandrillapp.com/api/docs/index.php.html
 Users Calls
 Messages Calls
 Tags Calls
 Rejects Calls
 Whitelists Calls
 Senders Calls
 Urls Calls
 Templates Calls
 Webhooks Calls
 Subaccounts Calls
 Inbound Calls
 Exports Calls
 Ips Calls
 Metadata Calls
Example Message Call
$mandrill = new Mandrill('YOUR_API_KEY');
$message = array( 'html' => '<p>Example HTML content</p>',
'text' => 'Example text content',
'subject' => 'example subject',
'from_email' => 'message.from_email@example.com',
'from_name' => 'Example Name',
'to' => array( array( 'email' => 'recipient.email@example.com', 'name' => 'Recipient Name', 'type' => 'to' )
),
'headers' => array('Reply-To' => 'message.reply@example.com'),
'important' => false,
'track_opens' => null,
'track_clicks' => null,
'bcc_address' => 'message.bcc_address@example.com',
'signing_domain' => null,
'tags' => array('password-resets'),
'subaccount' => 'customer-123',
'google_analytics_domains' => array('example.com'),
'attachments' => array( array( 'type' => 'text/plain', 'name' => 'myfile.txt', 'content' => 'ZXhhbXBsZSBmaWxl' ) ),
'images' => array( array( 'type' => 'image/png', 'name' => 'IMAGECID', 'content' => 'ZXhhbXBsZSBmaWxl' ) ) );
$async = false;
$ip_pool = false;
$send_at = false; //UTC timestamp in YYYY-MM-DD HH:MM:SS
$result = $mandrill->messages->send($message, $async, $ip_pool, $send_at);
print_r($result);
Array ( [0] => Array (
[email] => recipient.email@example.com
[status] => sent
[reject_reason] => hard-bounce
[_id] => abc123abc123abc123abc123)
)
Inbound Email Processing
 Set Up an Inbound Domain
 Add a Route
 Test Inbound Webhooks
 Inbound Events Format
Set up an inbound domain
 Go to Inbound in your Mandrill account.
 Add the domain or subdomain name where you’ll receive mail and click the
+ Add New Inbound Domain button.
 Click the DNS Settings button for any domain you’ve added to get the DNS
records you’ll need to add for your domain.
 Test the records for your domain using the Test button. We’ll check the MX
records for the domain to be sure they’re configured properly.
Add a Route
A route defines the local part (everything before the @ symbol) of the email
address(es) where you’ll receive mail.
Inbound emails are processed based on the routes you’ve set up, and
messages matching the routes are sent to your specified URL(s) as a webhook.
The following link describes the message format:
https://mandrill.zendesk.com/hc/en-us/articles/205583197-Inbound-Email-Processing-Overview#inbound-
events-format
Mandrill's webhooks allow our application to receive information about
email events as they occur. See the screenshot attached:
Other Considerations
Sending quota
Each account has an hourly sending quota based on the account reputation
and typical volume of email. When you first get started, since you have an
unknown reputation, the quota is very low but will quickly increase as you
start sending.
Size limits
Messages should be 25MB in size or less.
Attachments
You can include any type of attachment, including inline images. Messages
with attachments will be queued and all attachments run through a series of
virus scanning engines.
Thanks

More Related Content

Similar to Beginners guide to Mandrill

Using Parse Server to send emails via Mandrill
Using Parse Server to send emails via MandrillUsing Parse Server to send emails via Mandrill
Using Parse Server to send emails via Mandrill
Charles Ramos
 
Mule (aws)sns
Mule (aws)snsMule (aws)sns
Mule (aws)sns
g raghavender reddy
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
Celine George
 
Basic Web Host Manager Setup
Basic Web Host Manager SetupBasic Web Host Manager Setup
Basic Web Host Manager Setup
HTS Hosting
 
Setting up your own email server with hmailserver
Setting up your own email server with hmailserverSetting up your own email server with hmailserver
Setting up your own email server with hmailserver
rifqirr
 
High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...
High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...
High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...
Amazon Web Services
 
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Amazon Web Services
 
New Feature in CRM 2016
New Feature in CRM 2016New Feature in CRM 2016
New Feature in CRM 2016
Naveen Kumar
 
Choosing domain and IP address for Salesforce Marketing Cloud
Choosing domain and IP address for Salesforce Marketing CloudChoosing domain and IP address for Salesforce Marketing Cloud
Choosing domain and IP address for Salesforce Marketing Cloud
Arek Rafflewski
 
How To Build A Bulk Email Sending Application In PHP
How To Build A Bulk Email Sending Application In PHPHow To Build A Bulk Email Sending Application In PHP
How To Build A Bulk Email Sending Application In PHP
Sudheer Satyanarayana
 
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email InfrastructureLAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
SendGrid
 
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Chanaka Lasantha
 
Some useful c panel terms
Some useful c panel termsSome useful c panel terms
Some useful c panel terms
HTS Hosting
 
Send Mail
Send MailSend Mail
Send Mail
Mantavya Gajjar
 
IdP, SAML, OAuth
IdP, SAML, OAuthIdP, SAML, OAuth
IdP, SAML, OAuth
Dan Brinkmann
 
SoftLayer API 12032015
SoftLayer API  12032015SoftLayer API  12032015
SoftLayer API 12032015
Nacho Daza
 
Moving from Mandrill
Moving from MandrillMoving from Mandrill
Moving from Mandrill
Giedrius Rimkus
 
Dhcp, dns and proxy server (1)
Dhcp, dns and proxy server (1)Dhcp, dns and proxy server (1)
Dhcp, dns and proxy server (1)
Sahira Khan
 
MarvelSoft SchoolAdmin school software lan setup guide
MarvelSoft SchoolAdmin school software lan setup guideMarvelSoft SchoolAdmin school software lan setup guide
MarvelSoft SchoolAdmin school software lan setup guide
Ranganath Shivaram
 
SRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at ScaleSRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at Scale
Amazon Web Services
 

Similar to Beginners guide to Mandrill (20)

Using Parse Server to send emails via Mandrill
Using Parse Server to send emails via MandrillUsing Parse Server to send emails via Mandrill
Using Parse Server to send emails via Mandrill
 
Mule (aws)sns
Mule (aws)snsMule (aws)sns
Mule (aws)sns
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Basic Web Host Manager Setup
Basic Web Host Manager SetupBasic Web Host Manager Setup
Basic Web Host Manager Setup
 
Setting up your own email server with hmailserver
Setting up your own email server with hmailserverSetting up your own email server with hmailserver
Setting up your own email server with hmailserver
 
High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...
High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...
High Velocity DevOps: Four Ways to Leverage CloudFront in Faster DevOps Workf...
 
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
Automate Your Alexa Lambda Function Deployment Workflows Using AWS CodeCommit...
 
New Feature in CRM 2016
New Feature in CRM 2016New Feature in CRM 2016
New Feature in CRM 2016
 
Choosing domain and IP address for Salesforce Marketing Cloud
Choosing domain and IP address for Salesforce Marketing CloudChoosing domain and IP address for Salesforce Marketing Cloud
Choosing domain and IP address for Salesforce Marketing Cloud
 
How To Build A Bulk Email Sending Application In PHP
How To Build A Bulk Email Sending Application In PHPHow To Build A Bulk Email Sending Application In PHP
How To Build A Bulk Email Sending Application In PHP
 
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email InfrastructureLAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
LAPHP/LAMPSig Talk: Intro to SendGrid - Building a Scalable Email Infrastructure
 
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
 
Some useful c panel terms
Some useful c panel termsSome useful c panel terms
Some useful c panel terms
 
Send Mail
Send MailSend Mail
Send Mail
 
IdP, SAML, OAuth
IdP, SAML, OAuthIdP, SAML, OAuth
IdP, SAML, OAuth
 
SoftLayer API 12032015
SoftLayer API  12032015SoftLayer API  12032015
SoftLayer API 12032015
 
Moving from Mandrill
Moving from MandrillMoving from Mandrill
Moving from Mandrill
 
Dhcp, dns and proxy server (1)
Dhcp, dns and proxy server (1)Dhcp, dns and proxy server (1)
Dhcp, dns and proxy server (1)
 
MarvelSoft SchoolAdmin school software lan setup guide
MarvelSoft SchoolAdmin school software lan setup guideMarvelSoft SchoolAdmin school software lan setup guide
MarvelSoft SchoolAdmin school software lan setup guide
 
SRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at ScaleSRV307_Operating Your Serverless API at Scale
SRV307_Operating Your Serverless API at Scale
 

Recently uploaded

Top digital marketing institutein noida
Top digital marketing institutein noidaTop digital marketing institutein noida
Top digital marketing institutein noida
aditisingh6607
 
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
AI Driven Emotional Recognition in Digital Ads - Tarun Gupta
AI Driven Emotional Recognition in Digital Ads - Tarun GuptaAI Driven Emotional Recognition in Digital Ads - Tarun Gupta
AI Driven Emotional Recognition in Digital Ads - Tarun Gupta
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Story Telling Master Class - Jennifer Morilla
Story Telling Master Class - Jennifer MorillaStory Telling Master Class - Jennifer Morilla
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed GuideMastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
Kopa Global Technologies
 
How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...
How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...
How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...
Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...
Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
How to Kickstart Content Marketing With A Small Team - Dennis Shiao
How to Kickstart Content Marketing With A Small Team - Dennis ShiaoHow to Kickstart Content Marketing With A Small Team - Dennis Shiao
How to Kickstart Content Marketing With A Small Team - Dennis Shiao
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Playlist and Paint Event with Sony Music U
Playlist and Paint Event with Sony Music UPlaylist and Paint Event with Sony Music U
Playlist and Paint Event with Sony Music U
SemajahParker
 
Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...
Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...
Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy CrestodinaSEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
PickUp_conversational AI_Capex, Inc._20240611
PickUp_conversational AI_Capex, Inc._20240611PickUp_conversational AI_Capex, Inc._20240611
PickUp_conversational AI_Capex, Inc._20240611
Shuntaro Kogame
 
Efficient Website Management for Digital Marketing Pros
Efficient Website Management for Digital Marketing ProsEfficient Website Management for Digital Marketing Pros
Efficient Website Management for Digital Marketing Pros
Lauren Polinsky
 
Consumer Journey Mapping & Personalization Master Class - Sabrina Killgo
Consumer Journey Mapping & Personalization Master Class - Sabrina KillgoConsumer Journey Mapping & Personalization Master Class - Sabrina Killgo
Consumer Journey Mapping & Personalization Master Class - Sabrina Killgo
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Pillar-Based Marketing - Ryan Brock, DemandJump
Pillar-Based Marketing - Ryan Brock, DemandJumpPillar-Based Marketing - Ryan Brock, DemandJump
Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...
Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...
Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
PickUp_conversational AI_Capex, Inc._20240610
PickUp_conversational AI_Capex, Inc._20240610PickUp_conversational AI_Capex, Inc._20240610
PickUp_conversational AI_Capex, Inc._20240610
Shuntaro Kogame
 
Mastering Your Online Visibility - Fernando Angulo
Mastering Your Online Visibility - Fernando AnguloMastering Your Online Visibility - Fernando Angulo
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 

Recently uploaded (20)

Top digital marketing institutein noida
Top digital marketing institutein noidaTop digital marketing institutein noida
Top digital marketing institutein noida
 
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
 
AI Driven Emotional Recognition in Digital Ads - Tarun Gupta
AI Driven Emotional Recognition in Digital Ads - Tarun GuptaAI Driven Emotional Recognition in Digital Ads - Tarun Gupta
AI Driven Emotional Recognition in Digital Ads - Tarun Gupta
 
Story Telling Master Class - Jennifer Morilla
Story Telling Master Class - Jennifer MorillaStory Telling Master Class - Jennifer Morilla
Story Telling Master Class - Jennifer Morilla
 
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed GuideMastering The Best Restaurant Advertising Campaigns Detailed Guide
Mastering The Best Restaurant Advertising Campaigns Detailed Guide
 
How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...
How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...
How to Use a Free Book Funnel to Drive Highly Qualified Buyers Into Your Busi...
 
Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...
Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...
Crafting Seamless B2B Customer Journeys - Strategies for Exceptional Experien...
 
How to Kickstart Content Marketing With A Small Team - Dennis Shiao
How to Kickstart Content Marketing With A Small Team - Dennis ShiaoHow to Kickstart Content Marketing With A Small Team - Dennis Shiao
How to Kickstart Content Marketing With A Small Team - Dennis Shiao
 
Playlist and Paint Event with Sony Music U
Playlist and Paint Event with Sony Music UPlaylist and Paint Event with Sony Music U
Playlist and Paint Event with Sony Music U
 
Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...
Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...
Smart Tools, Smarter Business -15 AI Tools to Optimize Your Workflows from Id...
 
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy CrestodinaSEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
SEO in the AI Era - Trust, Quality and Content Discovery - Andy Crestodina
 
PickUp_conversational AI_Capex, Inc._20240611
PickUp_conversational AI_Capex, Inc._20240611PickUp_conversational AI_Capex, Inc._20240611
PickUp_conversational AI_Capex, Inc._20240611
 
Efficient Website Management for Digital Marketing Pros
Efficient Website Management for Digital Marketing ProsEfficient Website Management for Digital Marketing Pros
Efficient Website Management for Digital Marketing Pros
 
Consumer Journey Mapping & Personalization Master Class - Sabrina Killgo
Consumer Journey Mapping & Personalization Master Class - Sabrina KillgoConsumer Journey Mapping & Personalization Master Class - Sabrina Killgo
Consumer Journey Mapping & Personalization Master Class - Sabrina Killgo
 
Pillar-Based Marketing - Ryan Brock, DemandJump
Pillar-Based Marketing - Ryan Brock, DemandJumpPillar-Based Marketing - Ryan Brock, DemandJump
Pillar-Based Marketing - Ryan Brock, DemandJump
 
Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...
Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...
Data-Driven Personalization - Build a Competitive Advantage by Knowing Your C...
 
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
Get Off the Bandwagon - Separating Digital Marketing Myths from Truth - Scott...
 
PickUp_conversational AI_Capex, Inc._20240610
PickUp_conversational AI_Capex, Inc._20240610PickUp_conversational AI_Capex, Inc._20240610
PickUp_conversational AI_Capex, Inc._20240610
 
Mastering Your Online Visibility - Fernando Angulo
Mastering Your Online Visibility - Fernando AnguloMastering Your Online Visibility - Fernando Angulo
Mastering Your Online Visibility - Fernando Angulo
 
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
Digital Marketing Trends - Experts Insights on How to Gain a Competitive Edge...
 

Beginners guide to Mandrill

  • 2. What Is Mandrill? Mandrill is designed to help applications or websites that need to send transactional email like password resets, order confirmations, notifications and welcome messages. Technically, you can send any legal, non-spam emails through Mandrill.
  • 3. Points  How to Get Started with Mandrill?  SMTP Integration.  Delivery and Authentication.  API Integration.  Inbound Email Processing.  Webhooks.  Reputation and Hourly Quota.
  • 4. Get Started Create a Mandrill Account To get started, you'll want to create a new Mandrill account here: http://mandrill.com/signup/ Set Up Sending Domains Once you've SIGNED UP, one of the first things you'll want to do is set up your sending domain(s). • Sender Policy Framework (SPF) Record • Domain Keys Identified Mail (DKIM) Record
  • 5. SMTP Integration Find our SMTP credentials on the SMTP & API Info in settings page. The SMTP password is any active API key for your account, not the password used to log in to Mandrill.
  • 6. SPMTP Integration with PHP Mailer Class $mail->Host = 'smtp.mandrillapp.com'; // Specify main and backup server $mail->Port = 587; // Set the SMTP port $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'MANDRILL_USERNAME'; // SMTP username $mail->Password = 'MANDRILL_APIKEY'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable
  • 7. Email Delivery & Authentication Email can be easy to forge, so Mandrill automatically authenticates all emails sent through their system using multiple authentication methods to help improve deliverability. Set Up Sending Domains Add SPF and DKIM records to our sending domains to remove the 'on behalf of' or 'via' information. 1.Add new sending domain under settings. 2.Click the View DKIM Settings and View SPF Settings links for more detailed information 3.Click the Test DNS Settings button to check and verify the DNS settings for our sending domain.
  • 8. API Integration Mandrill has official API clients/wrappers for the following languages: Ruby, Python, NodeJS, JavaScript and PHP. Third-Party API Wrappers There is a list of known Mandrill API wrappers created by third parties for different languages. In php, we can use •https://github.com/kai5263499/mandrill-php •https://github.com/darrenscerri/Mindrill •https://github.com/MichMich/laravel-mandrill (LaravelPHP)
  • 9. API Endpoint All API URLs are relative to https://mandrillapp.com/api/1.0/. For example, the /users/ping API call is reachable at https://mandrillapp.com/api/1.0/users/ping.json.
  • 10. Mandrill PHP API Integration Requirements PHP 5.2.x or higher PHP cURL extension Install via composer  curl -s http://getcomposer.org/installer | php  Create composer.json  { "require": { "mandrill/mandrill": "1.0.*" } }  Install dependency: php composer.phar install
  • 11. Using the Library Mandrill API start by including the library and instantiating the Mandrill class. <?php require_once 'mandrill-api-php/src/Mandrill.php'; //Not required with Composer $mandrill = new Mandrill('YOUR_API_KEY'); ?>
  • 12. API Calls Mandrill API calls are described in the following link https://mandrillapp.com/api/docs/index.php.html  Users Calls  Messages Calls  Tags Calls  Rejects Calls  Whitelists Calls  Senders Calls  Urls Calls  Templates Calls  Webhooks Calls  Subaccounts Calls  Inbound Calls  Exports Calls  Ips Calls  Metadata Calls
  • 13. Example Message Call $mandrill = new Mandrill('YOUR_API_KEY'); $message = array( 'html' => '<p>Example HTML content</p>', 'text' => 'Example text content', 'subject' => 'example subject', 'from_email' => 'message.from_email@example.com', 'from_name' => 'Example Name', 'to' => array( array( 'email' => 'recipient.email@example.com', 'name' => 'Recipient Name', 'type' => 'to' ) ), 'headers' => array('Reply-To' => 'message.reply@example.com'), 'important' => false, 'track_opens' => null, 'track_clicks' => null, 'bcc_address' => 'message.bcc_address@example.com', 'signing_domain' => null, 'tags' => array('password-resets'), 'subaccount' => 'customer-123', 'google_analytics_domains' => array('example.com'), 'attachments' => array( array( 'type' => 'text/plain', 'name' => 'myfile.txt', 'content' => 'ZXhhbXBsZSBmaWxl' ) ), 'images' => array( array( 'type' => 'image/png', 'name' => 'IMAGECID', 'content' => 'ZXhhbXBsZSBmaWxl' ) ) ); $async = false; $ip_pool = false; $send_at = false; //UTC timestamp in YYYY-MM-DD HH:MM:SS $result = $mandrill->messages->send($message, $async, $ip_pool, $send_at);
  • 14. print_r($result); Array ( [0] => Array ( [email] => recipient.email@example.com [status] => sent [reject_reason] => hard-bounce [_id] => abc123abc123abc123abc123) )
  • 15. Inbound Email Processing  Set Up an Inbound Domain  Add a Route  Test Inbound Webhooks  Inbound Events Format
  • 16. Set up an inbound domain  Go to Inbound in your Mandrill account.  Add the domain or subdomain name where you’ll receive mail and click the + Add New Inbound Domain button.  Click the DNS Settings button for any domain you’ve added to get the DNS records you’ll need to add for your domain.  Test the records for your domain using the Test button. We’ll check the MX records for the domain to be sure they’re configured properly.
  • 17. Add a Route A route defines the local part (everything before the @ symbol) of the email address(es) where you’ll receive mail.
  • 18. Inbound emails are processed based on the routes you’ve set up, and messages matching the routes are sent to your specified URL(s) as a webhook. The following link describes the message format: https://mandrill.zendesk.com/hc/en-us/articles/205583197-Inbound-Email-Processing-Overview#inbound- events-format
  • 19. Mandrill's webhooks allow our application to receive information about email events as they occur. See the screenshot attached:
  • 20.
  • 21. Other Considerations Sending quota Each account has an hourly sending quota based on the account reputation and typical volume of email. When you first get started, since you have an unknown reputation, the quota is very low but will quickly increase as you start sending. Size limits Messages should be 25MB in size or less. Attachments You can include any type of attachment, including inline images. Messages with attachments will be queued and all attachments run through a series of virus scanning engines.

Editor's Notes

  1. 2