+ All Categories
Home > Technology > Using Parse Server to send emails via Mandrill

Using Parse Server to send emails via Mandrill

Date post: 22-Jan-2018
Category:
Upload: charles-ramos
View: 106 times
Download: 0 times
Share this document with a friend
15
Using Parse Server to send emails via Mandrill
Transcript
Page 1: Using Parse Server to send emails via Mandrill

Using Parse Server to send emails via Mandrill

Page 2: Using Parse Server to send emails via Mandrill

IntroductionMandrill is an email infrastructure service offered as an add-on for MailChimp that you can use to send personalized, one-to-one e-commerce emails, or automated transactional emails. This tutorial will walk you through creating a sample app for Android on how to set up and connect Mandrill API to your Parse Server application.

Page 3: Using Parse Server to send emails via Mandrill

PrerequisitesYou will need to have Android Studio installed, preferably at the newer version. Before beginning this tutorial, you should have some familiarity with working with this tool together with Parse Server. Tutorials for downloading setting up Android Studio, Parse Server and others can be found in the links below.

・ Android Studio Official Website・ Android Guide With Parse Server・ Webhosting Guide・ Verified email domain

Page 4: Using Parse Server to send emails via Mandrill

Step 1 — Create a MailChimp AccountGo to MailChimp Website to create an account and proceed to fill your information as needed. If it all went well you will end on the main dashboard page.

Page 5: Using Parse Server to send emails via Mandrill

Step 2 — Create and get your API keyFirst you need to add Mandrill to your MailChimp account by clicking on your Name (on the top left corner) > Account and go to Transactional option. In this menu, click on the Add Mandrill link. A popup will appear and you can click on Start Trial to test it for free.

Page 6: Using Parse Server to send emails via Mandrill

Then, you will be redirected to the following page:

Click on Launch Mandrill option.

Page 7: Using Parse Server to send emails via Mandrill

Now you should be on Mandrill main dashboard page. To create your API key, go to the Settings option and you will see the following page:

Click on + Add API Key and a key should be created for you.

Page 8: Using Parse Server to send emails via Mandrill

Your API Key should look like the image below:

Page 9: Using Parse Server to send emails via Mandrill

Step 3 — Set up your Sending DomainRefer to the yellow message on the top of your page and click on Set up your sending domain, this will redirect you to the Domains page.

On the field yourdomain.com, you need to paste the domain of your site that is being hosted on Back4App, and click on + Add. You can configure your domain following the Webhosting Guide.

Page 10: Using Parse Server to send emails via Mandrill

You will be redirected to the following page:

Now you’re going to need to setup a DKIN and an SPF settings to your domain, in addition to verify an email domain. Back4App already have these two settings done for you, so you just need to have a verified email domain. If you don’t have one, you can ask for through our support website chat :)

However, you can use another webhosting service to host your Domain Name System (DNS). This allows you to create and manage your own domain email, but you would need to configure manually your DKIM and SPF records, besides of have to reference your back4app site. You can find more information at the documentations of the webhosting service that was chosen and at the Mandrill official documentation of DNS Records.

When the setup is done, the following message should show on top of the page.

Page 11: Using Parse Server to send emails via Mandrill

Step 4 — Implement Cloud CodeFor sending emails, we are going to create a function in the Cloud Code named “sendEmail” and call it from the Application.

Click here (https://pastebin.com/mpBzw24v) to see the code at paste bin.

Page 12: Using Parse Server to send emails via Mandrill

After that, you just need to call this function from your App. Below, there is an example on how to do that in an Android Application.

Click here (https://pastebin.com/V0JVy11C) to see the code at paste bin.

Page 13: Using Parse Server to send emails via Mandrill

After changing all the fields to match the sender and the receiver emails information, just running the application will send the email.

Page 14: Using Parse Server to send emails via Mandrill

ConclusionYour basic configuration for using Mandrill API is now ready. Also, you can explore the complete Mandrill Documentation.

In any doubts, don’t be afraid to ask our support team through our website chat for some help.

Page 15: Using Parse Server to send emails via Mandrill

Recommended