SlideShare uma empresa Scribd logo
1 de 22
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

Mais conteúdo relacionado

Semelhante a 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 MandrillCharles Ramos
 
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 ModuleCeline George
 
Basic Web Host Manager Setup
Basic Web Host Manager SetupBasic Web Host Manager Setup
Basic Web Host Manager SetupHTS 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 hmailserverrifqirr
 
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 2016Naveen 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 CloudArek 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 PHPSudheer 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 InfrastructureSendGrid
 
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 termsHTS Hosting
 
SoftLayer API 12032015
SoftLayer API  12032015SoftLayer API  12032015
SoftLayer API 12032015Nacho Daza
 
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 guideRanganath 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 ScaleAmazon Web Services
 

Semelhante a 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
 

Último

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 

Último (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 

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.

Notas do Editor

  1. 2