Blog

How to Use Backendless Email Templates

by on September 5, 2019

One of our key standard features is the ability to send emails through Backendless Console. We offer prebuilt email templates or you can create your own email template. In this article, we will show you how to do the latter.

Email is still a powerful tool to maximize your users’ engagement with your application. Whether this is through a simple welcome email with links to helpful tips and tricks or a special offer, email messages carry tremendous value for your business. That’s why Backendless includes built-in emailing functionality.

To use this functionality, you must first fill in the fields for the custom SMTP server, as shown below.

Backendless SMTP Email Settings

To create a template for an e-mail, you need to go to the Messaging page in Backendless Console. Next, choose “Create new template” from the Template drop-down menu. In the subsequent popup, enter your template’s name.

Create Email TemplateName New Email TemplateThe body of the letter can contain any information you choose, such as a special offer or tips for using your application.

Backendless Email Template Creator

You can then send your new email to an email list. For example, if you choose to use curl, you can simply modify the following code the match your keys. If you would prefer to use an SDK, you can read the documentation here for guidance.

<code>
curl -X POST -H Content-Type:application/json -v https://api.backendless.com/<your-app-id>/<your-secret-key>/emailtemplate/send -d '{"template-name":"<yourTamplateName>", "addresses": [<yourListEmails>]}'
</code>

Below is another curl example. In this one, we send a birthday greeting to our users:

<code>
curl -X POST -H Content-Type:application/json -v https://api.backendless.com/<your-app-id>/<your-secret-key>/emailtemplate/send -d '{"template-name":"<yourTamplateName>", "criteria": "birthday=<today>"}'
</code>

Thus, if everything is done correctly, everyone you specify in the request will receive your letter.

Thanks for reading. We hope you enjoy sending your own emails with custom templates today!