This article provides step-by-step instructions to configure email settings in Sendgrid.
Introduction
SendGrid is a cloud-based SMTP provider that allows you to send email without maintaining email servers. SendGrid manages all technical details, from scaling the infrastructure to ISP outreach and reputation monitoring to whitelist services and real-time analytics.
library_add_check |
Prerequisites Ensure that you have admin access to your SendGrid account. |
Configure SendGrid Account
You can sign up for SendGrid at https://sendgrid.com/pricing and select your pricing plan.
Add Domains in SendGrid
Generate DNS records for your domain and dedicated IPs to authenticate them on Sendgrid. Then, add them to your DNS servers. After that validate the same on Sendgrid. For more information refer to the below listed related docs:
- To set up a domain
- To set up link branding
- To set up reverse DNS for dedicated IP
- Configure SSL for click tracking domain
- Configure Sign in with Apple
Create API Keys from SendGrid
Create API keys with full access.
info |
Information Make sure to note the API key in a secure location as it will not be visible again. |
Configure SendGrid Settings in MoEngage UI
- Log in to your MoEngage Dashboard.
- Go to Settings > Under Channels > Email > Sender Configuration tab> Click Add Sender
- In the following Add Sender screen that appears, add the following SMPTP details as shown below.
info Information
All of the following details are case-sensitive.
Field Description Sender Name Enter a sender name.
SMTP Host Name Enter smtp.sendgrid.net
SMTP Port
Enter 587.
To avoid rate limits set by some companies, port 587 is the suggested port.
SMTP Protocol Select TLS. SMTP Password Enter the password. This is the API key created above. WebApi Key Enter the key. This is the API key created above. - Configure Unsubscribe Settings based on your requirements. For more information, refer to Track Email Unsubscribes.
- Configure the List unsubscribe email settings based on your requirements, For more information, refer to List Unsubscribe Email.
- Click Save. The added connector is listed under the Sender configuration tab.
- Go to the General Settings tab.
- From the Set a default sender drop-down, select the sender you added.
- From the User Attribute that stores the user’s email address drop-down, select Email (Standard).
- In the "From" email address(s) field, add the from address. The domain (the part after @) must be a validated one on SendGrid.
- Save the settings. The “from address” mailbox added above will receive a verification email.
- Click the confirmation link to validate the same.
info |
Information From Address: |
Configure SendGrid Bounce and Complaint Settings.
- Copy the URL in the Bounce & Complaint Tracking from email settings.
- Use the below API to configure event webhook:
curl --location 'https://api.sendgrid.com/v3/user/webhooks/event/settings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_KEY_GENERATE_ABOVE' \
--data '{
"url": "Bounce and Complaint tracking URL from Step 1",
"enabled": true,
"group_resubscribe": true,
"delivered": true,
"group_unsubscribe": true,
"spam_report": true,
"bounce": true,
"deferred": true,
"unsubscribe": true,
"processed": false,
"open": true,
"click": true,
"dropped": true,
"friendly_name": "MOE App name"
}'To successfully configure the event webhook, make sure to add the following inputs to the API:
- Enter the API key obtained from the above Create API Keys from SendGrid section by replacing
API_KEY_GENERATE_ABOVE
in the API. - Paste the URL obtained from step 1 in the above API, by replacing
"Bounce and Complaint tracking URL from Step 1"
- Enter the dashboard name, by replacing
"MOE App name"
in the above API.
- Enter the API key obtained from the above Create API Keys from SendGrid section by replacing
Test Email Settings
For more information, refer to Test the Email Settings.