A guide to configuring SendGrid SMTP for email delivery in your Hub
🧰 What You Will Need
- A Hub (Start plan or higher)
- A SendGrid account
- A domain with "Edit" access to your DNS records
- Some knowledge of email authentication methods
- To have understood how "Use a Custom Host for your Hub Emails" works
What can I use this for?
If you're sending a large volume of emails regularly, it's essential to have an interface that allows you to send emails at scale. Ensure that your application can handle a high volume of emails efficiently. Services like SendGrid can be utilized as a mail server for your Hub emails.
Configuring SendGrid as your mail server for Membership.io Hubs involves authenticating your domain and setting up SMTP for email delivery. We recommend using additional authentication methods to ensure the best email deliverability. This guide will take you through just how you can do that in Membership.io through SendGrid.
Processes
To set up SendGrid as the mail server for your Hub emails, you can do the following:
- Authenticate your domain
- Verify your sender identity
- Initiate your SMTP relay configuration
- Configure Custom Host for your Hub's email
Step 1: Authenticate your domain
First, log in to your SendGrid account and navigate to Settings > Sender Authentication. Click Get Started under "Authenticate Your Domain."
NOTE: If you are using Cloudflare, you may encounter restrictions on enabling the Proxy status option for SendGrid records. In these situations, it's okay to turn this setting off for the records.
Next, follow the instructions for adding your domain and modifying your DNS records. You can follow this guide on how to set up domain authentication.
Now, to ensure SendGrid is authorized to send emails on your behalf, you need to also set up an SPF record by adding the following TXT record on your DNS console:
- If you have no SPF record on your domain, simply publish the following SPF record on it:
v=spf1 include:sendgrid.net -all
- If you already have an SPF record, simply insert
include:sendgrid.net
right before the terminating mechanism in that record.
For example, if your current SPF record looks like this:
v=spf1 a -all
update it to:
v=spf1 a include:sendgrid.net -all
NOTE: If you need help with this, please feel free to contact SendGrid support.
Once done, click Verify to ensure your DNS records are updated successfully.
Note that DNS record updates may take up to 24 hours, but usually only 10-15 minutes.
Step 2: Verify a single sender
After authenticating your domain, we recommend verifying the ownership of a single email address to use as a sender. To protect your sending reputation and uphold legitimate sending behavior, SendGrid requires you to verify your sender identity. To proceed, click Verify a Single Sender under "Single Sender Verification."
Step 3: Initiate your SMTP relay configuration
In SendGrid, the first thing to do is to navigate to the Email API > Integration Guide and choose SMTP Relay as your setup method.
Next, enter a name for your API Key and then click on Create Key. You are free to use any name here.
Then, you'll be given a string of alphanumeric characters to serve as your password. You'll need this later, along with the other settings shown to you such as the SMTP server name, port numbers, and username (See Step 3). Once your settings have been updated, go back to SendGrid and click Next: Verify Integration > Verify Integration after checking "I've updated my settings."
Step 4: Configure Custom Host for your Hub's emails
Next, go to your Hub in Membership.io and enable "Custom Host" under Settings > Emails > Configuration where you will include these email settings into your Hub.
NOTE: Please use the following configuration:
- Mail Port: 587
- Encryption: TLS
- Username: apikey (DO NOT use the email address you're using to log in to SendGrid mail host)
- Password: (your API key password on SendGrid)
Test the configuration
Send a test email
You can go to your Membership.io Audiences section and send a welcome email to a member to verify the integration.
Check email delivery
Confirm that the test email is received and verify that the email details match the configured settings.
Additional note:
If your audience members are still not receiving the emails even after adding the required DNS records, it might be necessary to whitelist email addresses.
Basically, they need to get the sender's email address (i.e., the email address you're using to send emails to them) whitelisted by their email provider so that their SPAM blockers do not restrict the incoming emails from that domain.