- Best Practices
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
This post was written and contributed by Max Katz, head of Developer Relations at Appery.io.
Many developers using the cloud-based mobile app platform, Appery.io, send e-mails from their apps for registration, confirmation, and everything else. To make it simple to use the Mailgun API in Appery.io, we’ve introduced a Mailgun plug-in in Appery.io.
The plug-in has a sample app with one page that shows how to send an email using the API. You can use the sample app as a starting point or add the plug-in to any existing app.
Before I show you how to use the plugin, I want to tell you a little bit more about the Appery.io development platform.
Appery.io is a cloud development and runtime platform that enables to build cross-platform enterprise mobile apps connected to APIs very fast. The following are the platform benefits and features:
Quickly build cross-platform mobile apps with visual drag-and-drop Appery.io App Builder. The apps are created with open source technologies such as jQuery Mobile, Ionic, Bootstrap, and Apache Cordova
Easily connect to external SQL database and other enterprise data sources with Appery.io API Express
Quickly send targeted push notifications with Appery.io Push
Quickly add a database to your app with Appery.io Database
Quickly write any server-side logic and create custom APIs with Appery.io Server Code
Instantly test or share your apps with anyone on any device with the Appery.io Tester app
Quickly package your app for iOS, Android, and Windows Phone to submit to an app store with Appery.io Cloud Build
Now that we’ve introduced the platform, next we are going to build a mobile app that uses the Mailgun API to send email messages from the app.
The first step is to add a plug-in to a new or existing app. The plug-in is available for Ionic and jQuery Mobile apps. If you’re familiar with AngularJS, you can use the Ionic version. If you’re not yet familiar with AngularJS, it’s better to try the jQuery Mobile version (just skip one section ahead)
.
Inside the App Builder (you can use an existing app or create a new one), select Create new > From Plugin
Find Mailgun Mail API
under Communication
category. Select the check box for the plug-in and click the Import selected plugins
button.
Importing Mailgun Email API plugin (Ionic)
Inside the App Builder (you can use an existing app or create a new one), select Create new > From Plugin.
Find Mailgun Mail API
under the Communication
category. Select the check box for the plug-in and click the Import selected plugins
button.
On the next page, select the check box to open the setting file. Also set the start page to Mailgun.
Then click the Apply settings
button. The plug-in will be added to your app.
You’re done. The plug-in has been added to your app.
Now that the plug-in is available in the app, there is some minimal configuration that you need to do. There are three parts in this section:
Setting up the Mailgun domain
Securing the Mailgun API credentials
Setting up a secure proxy
The Mailgun domain identifies your account.
If you don’t have a Mailgun account, sign up!
Open your domain settings and copy the domain value — that’s everything before .mailgun.org
Paste the value for domain
property in the Services/Mailgun_settings
file.
The Mailgun API uses Basic Authentication for authentication. You want to make sure the authentication information is not exposed on the client, so you’re going to keep it secure on the server.
Inside the App Builder, click Database
(toolbar, upper right).
Click Create new database
. Call the database mailgunDB
.
Click Create new collection
. Call the collection secret
.
Inside the secret collection, create two columns by pressing the +Col
link. Both columns will contain strings.
keyName
(string type)
keyValue
(string type)
Click +Row
to add data to the collection.
In the keyName column, enter mailgunAuthProxy.
Since Mailgun uses Basic Authentication, you need to encode the username and password. The simplest way to do this is to open the Chrome Dev. Tools Console tab, enter the following and press Enter (you will find the API key in the domain dashboard:
>window.btoa(“api:key-0ce1xxxxxx”)
;
The encoded value will be shown on the next line:
>”YXBpOmtleS0wYxxxx
“
Copy the entire value (including the at the end). Go back to the database collection, for mailgunAuthProxy
value enter “Basic
” (with space) and then paste the entire value.

Now the Mailgun API credentials are secure on the server. Next, you are going to set up the proxy to use this value.
Setting up the proxy is very quick:
Open the Proxy page.
Click Create new proxy
. Name the proxy MailgunProxy
.
Select Use proxy + store sensitive data option
.
For Database
, select mailgunDB
For Collection
, select secret
For Key column
, select keyName
For Value column
, select keyValue
Click Save
.
Go back to the app in the App Builder. Open the Mailgun sending
service. In the Settings
tab, refresh the proxy list, then select Mailgun_Proxy.
If you are building an Ionic app, there is one more step you need to complete:
Open Pages/mailgun
, and switch to the Scope
tab.
For the email scope variable, changes its type to Email
(this is a bug and will be fixed soon).
You can also optionally open Pages/index and set the Header text to Mailgun API and set its Color to positive.
You are now ready to run the app.
There are two ways to run and test your app. You can run the app in the browser or directly on the device. I will also show you how to share the app with anyone.
Quickly test the app in the browser by clicking the Test button inside the App Builder. Here is how the app looks when running in the browser:
It’s is also very easy to test the app on an actual device. You don’t even need to install the app. Simply install the Appery.io Tester app on your iOS or Android device and quickly launch the app. When you sign into the Tester app, you will see all the apps that you have created and can quickly launch them. When you run the app via the Tester app, you can also quickly test any native APIs. 
Appery.io Tester app for iOS
It’s also easy to share the same app with your customers, clients, colleagues, and friends. All they need to do is to install the Appery.io Tester app. Give them a special share code and they will be able to run your app.
Do you want to build apps fast? Start developing with Appery.io’s free trial plan.
Last updated on August 28, 2020
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
The Difference Between SMTP and API
The Basics of Email Dark Mode
COVID-19 Survey: How the Pandemic Has Affected Email Sending
The Top Email Clients and Email Apps of 2021
The Benefits of Email Automation
Mailgun Just Got Better For Client Management
How To Avoid Emails Going To Spam
Understanding DKIM: How It Works and Why It's Necessary
Which SMTP Port Should I Use? Understanding Ports 25, 465, & 587
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Become an Email Pro With Our Templates API
Google Postmaster Tools: Understanding Sender Reputation
Navigating Your Career as a Woman in Tech
Implementing Dmarc – A Step-by-Step Guide
Email Bounces: What To Do About Them
Announcing InboxReady: The deliverability suite you need to hit the inbox
Black History Month in Tech: 7 Visionaries Who Shaped The Future
How To Create a Successful Triggered Email Program
Designing HTML Email Templates For Transactional Emails
InboxReady x Salesforce: The Key to a Stronger Email Deliverability
Implementing Dmarc – A Step-by-Step Guide
Announcing InboxReady: The deliverability suite you need to hit the inbox
Designing HTML Email Templates For Transactional Emails
Email Security Best Practices: How To Keep Your Email Program Safe
Mailgun’s Active Defense Against Log4j
Email Blasts: The Dos And Many Don’ts Of Mass Email Sending
Email's Best of 2021
5 Ideas For Better Developer-Designer Collaboration
Mailgun Joins Sinch: The Future of Customer Communications Is Here
Always be in the know and grab free email resources!
By sending this form, I agree that Mailgun may contact me and process my data in accordance with its Privacy Policy.