Emails from UCSF Library website via SendGrid - ucsf-ckm/ucsf-library-ux-and-web-documentation GitHub Wiki
To improve the speed and reliability of email delivery from the UCSF Library website, we have implemented a solution using SendGrid and WP Mail SMTP.
Implementation steps
- Create SendGrid account
- Set up domain authentication
- Upgrade SendGrid account to paid tier
- Install WP Mail SMTP plugin in WordPress
- Add SendGrid email API key to WP Mail SMTP
- Test in dev environment
- Push to live environment
Configuration notes
SendGrid
SendGrid is the cloud-based SMTP email delivery service that handles emails for the UCSF Library website.
- Domain authentication allows emails to be sent from a UCSF email address via SendGrid. See How to Set Up Domain Authentication for configuration instructions. The records added to UCSF's DNS can be found in the SendGrid account under Settings > Sender Authentication > Domain Authentication.
- The free tier for SendGrid is limited to 100 emails per day, so we upgraded to the Essentials 50K tier.
- To create a SendGrid API Key for WP Mail SMTP, go to Settings > API Key.
- Disable the Open Tracking and Click Tracking features under Settings > Tracking.
WP Mail SMTP
WP Mail SMTP is the WordPress plugin that connects the UCSF Library website with SendGrid's email API.
- Install the plugin by the usual process in Pantheon. Purchasing a license for the plugin gives access to additional features, but we have determined that we don't need these features at this time.
- Set the default 'From Email' to [email protected] and the default 'From Name' to UCSF Library.
- Turn on the 'Force From Email' setting. In order to use SendGrid with our authenticated domain, emails must come from a UCSF email address. If forms used a non-UCSF email address as the 'From Email', the emails would not be delivered.
- Choose SendGrid as the mailer.
- Add the API Key created in the SendGrid account.
- Add the Sending Domain that has been authenticated in the SendGrid account.
WP Forms
WP Forms is the WordPress plugin used to create web forms for the UCSF Library website.
- When creating/modifying a web form notification, make sure the Reply-To field is populated with the name and email address of the person who submitted the form (in the format "{name_field_id} <{email_field_id}>") so tickets are created properly in Zendesk with the person who submitted the form becoming the ticket requester.