Sendgrid is a popular email relay system that ensures email sent from your website are delivered to your recipients. In this article we will explain how to configure Sendgrid and the Sendgrid WordPress plugin to help improve email deliverability.
Step 1: Sign up for a Sendgrid account
The first step in configuring Sendgrid is to sign up for an account. You can see the Sendgrid plan offerings from their pricing page. As of this writing, Sendgrid has a free plan offering that allows up to 40,000 emails for free for your first 30 days, and 100 emails per day after. Select the plan you wish to use based on the amount of email you anticipate your website will send. For the purposes of this article, we have selected the free account.
After entering your information, Sendgrid will send you an email asking you to verify your account. Click the button to “Confirm Email Address” in your email to verify your account before moving on to the following steps.
Step 2: Sendgrid Domain Validation
Next you will need to add records to your DNS host to validate with Sendgrid. To get started, login to Sendgrid (https://app.sendgrid.com/) and select Settings > Sender Authentication from the left-hand navigation.
On the Sender Authentication page, look to the Domain Authentication settings. Click “Get Started” in the “Authenticate Your Domain” box.
Select your DNS host from the dropdown menu on the next page, then select whether or not you would like to “whitelabel” emails being sent through Sendgrid to show your own domain. For the purposes of this article, we selected “no.”
Now enter the domain from which you would like to send emails. Use the preview provided by Sendgrid to ensure the email address appears as you would like. Then click “Next.”
Sendgrid will now display a list of CNAME records to add to your DNS host. Use the “Copy” buttons to copy the Host and Value entries over to your DNS host:
In our example, the domain in question is hosted at Namecheap, and we were able to add the CNAME records under the “Advanced DNS” section of their dashboard.
After you have added the records, click the “Verify” button in the Sendgrid dashboard to ensure your records were set correctly. Sendgrid will then check the DNS records and display a green checkmark if the settings are correct.
Step 3: Install & Activate WordPress Plugins
Now that your domain has been verified in Sendgrid, it is time to install and configure your WordPress email settings. Log into the WordPress Admin Dashboard for your website, and click “Plugins” from the left-hand navigation. Then, click “Add New” at the top of the page. Search “Sendgrid” and select the “Sendgrid” plugin which is also authored by Sendgrid.
Select to install the Sendgrid plugin by Sendgrid, then “Activate” immediately after. Please note: If you wish to send email via SMTP instead of Sendgrid’s API (recommended), you will also need to install the Swift Mailer plugin.
Step 4: Enter API credentials
Now that Sendgrid is installed and active on your WordPress website, head back to the Sendgrid dashboard (https://app.sendgrid.com/). Select Settings > API Keys from the left-hand navigation, and select to create an API key with “Full Access” permissions.
Next, Sendgrid will display your API key. For security purposes, Sendgrid cannot display the API key to you again. Be sure to save your API key in a safe place.
Click to copy the API key after saving it in a secure place, and navigate back to your WordPress Admin Dashboard. There, under Settings > Sendgrid, enter your API key in the first box. In the second box, ensure “API” is selected (if you select SMTP instead, you will also need the Swift Mailer plugin installed).
Fill in the rest of the information as you’d like, and save your settings when finished by clicking “Update Settings” at the bottom of the page.
Step 5: Send a test email
Last, you will need to send a test email to ensure your settings in the Sendgrid plugin are working correctly. On the Settings > Sendgrid page, scroll to the bottom and fill in the fields to send a test email.
Sendgrid will confirm the email was sent at the top of the page. Check your inbox to ensure you got the message! (You may want to check your spam folder if you haven’t received the message after a few minutes).
Sendgrid has now been successfully configured! Going forward, you can use the Sendgrid Dashboard to track email delivery, errors, spam reports, and bounced emails.