-
Notifications
You must be signed in to change notification settings - Fork 3
Sendgrid
If we want to use a dedicated IP to help protect against our emails going to spam and improve deliverability, we would need the Pro plan at $79.95/month, which allows us 100,000 emails per month.
However, we probably don't need the dedicated IP. In that case, we can go for the Essentials Plan, which has 2 options.
- $14.95/month: 40,000 emails per month
- $29.95/month: 100,000 emails per month
- Both options include responsive email templates, global support, and real-time analytics.
This really depends on our estimated user base. Since we could send an email report for every task completed, if there are a lot of users we could quickly surpass 40,000/month. But the smaller plan should be fine to start.
Sendgrid provides tools for creating, retrieving, and updating HTML dynamic templates (with versioning).
- Navigate to Sendgrid's transaction templates page and click Create Template.
- Add a unique template name and click Save.
- To begin editing the template, click Add Version.
- Select an editor and click Continue.
- Design the template, using the Handlebars.js syntax for dynamic values, e.g.
<p>{{name}} completed a task at {{company}}.</p>
- Set up a POST request to Sendgrid's
POST /mail/send
endpoint. - In the request body, specify the
template_id
from the template you created above. - Inside the
personalizations
array in the request body, provide adynamic_template_data
object that includes the variable names (as specified in the template) and their values.
{
"personalizations": [
{
"to": [
{
"email": "[email protected]",
"name": "John Doe"
}
],
"dynamic_template_data": {
"name": "Anthony Wang",
"company": "Starbucks"
}
}
],
"from": {
"email": "[email protected]",
"name": "Sam Smith"
},
"template_id": "d-a6eda312ad2a4e6d876135c0e0d4bdb0"
}
More examples including full code for setting up a Sendgrid POST request with Node.js can be found here.
DDA iOS and Android App. Developed by Code the Change Foundation
Developer Documentation
Mockup
Database
API
User Management
React Native
Research