Using SendGrid Plugin for Bulk Mailing
This document shows how to define bulk mailing using the SendGridEmail plugin
In this document, we will demonstrate how you can set up bulk mailing to all your Appery.io Database users by using the Server Code SendGridEmail plugin.
SendGrid Account
Before you you can send emails with the SendGridEmail plugin, you will need to create a SendGrid account to get an API key.
Please check out this section to learn more.
- First of all, create an Appery.io database and name it DbWithUsers.
- Open the Users predefined collection and add several email addresses to it by clicking the +Row button and providing the needed data:
- Go to the Server Code > Plugins tab and import the SendGridEmail plugin:
Note that with this plugin, several related snippets have been added, so we will need to edit this script to customize it.
- Click Create script to create a new script, name it to BulkMailingWithSendGrid and clear the default code.
- Then filter the snippets list by SendGridEmail and click the corresponding link to insert the sendEmailBulkMailing snippet:
- In the code editor, locate the from and apiKey entries, replace their variables with your own SendGrid parameters, and save the script:
- Under the script Settings tab, select your database with the users' list (in our case, it's DbWithUsers):
- That's all and now, you can set any subject and body and send a bulk email to your app users.
Scheduling Bulk Email Sending
If needed, you can additionally schedule an automatic job that will send all script emails at a specific time.
To do it, switch to the Jobs tab and specify the needed data for your BulkMailingWithSendGrid script:
Updated about 3 years ago