Sendgrid
Guide for setting up the Omnium Sendgrid plugin.
SendGrid integration
Settings in Omnium
- Go to Configuration -> Advanced -> Email Client.
- Set type to Sendgrid.
- Add the API key to the "Key Name" field.
Inbound Parsing
To handle incoming e-mails for adding replies to carts, orders, projects, etc., follow SendGrid's documentation: SendGrid Inbound Parse Documentation
Set up MX Records
- Navigate to the MX Records page on your hosting provider’s website. If you're unsure who your hosting or DNS provider is, contact your website administrator.
- Create a new MX record for the subdomain (e.g.,
parse.yourdomain.com
) you want to process incoming email. This hostname should be used exclusively for parsing incoming emails. - Assign the MX record a priority of 10 and point it to mx.sendgrid.net.
Inbound Settings in SendGrid
NB! It is recommended to use the POST the raw, full MIME message option as this is more robust with respect to different email formats. See the section "Using Raw-format with SendGrid" for details. The below example relies on the automatic parsing done by sendgrid.
- Go to Settings -> Inbound Parse.
- Click "Add host & URL".
- Add your subdomain (same as MX record, e.g., "incoming").
- Add your Domain (verified domain).
- Set the Destination URL based on your environment:
Environment | Destination URL in SendGrid |
---|---|
Test | https://apitest.omnium.no/api/InboundParse |
Prod | https://api.omnium.no/api/InboundParse |
- Optional: Check "Check incoming emails for spam".
- Do not check "POST the raw, full MIME message".
Inbound Settings in Omnium
- Go to Configuration -> Advanced -> Email Client.
- Add the new inbound e-mail address to "Inbound E-mail Address".
Using Raw-format with SendGrid
Due to varying formats across different email providers, formatting issues may sometimes occur when using the standard model received from SendGrid. A way to overcome this issue is leveraging the SendGrid option "POST the raw, full MIME message" when setting up the inbound parse hook. This better preserves the formatting information related to the email.
Steps to Use the Raw Option:
- Go to Settings -> Inbound Parse
- Click "Add host & URL"
- Add subdomain (same as MX record, e.g., "incoming")
- Domain: Add your verified domain
- Destination URL:
https://api.omnium.no/api/InboundParse/Raw
- Optional: Check incoming emails for spam
- Check the option "POST the raw, full MIME message"
Inbound Settings in Omnium:
- Go to Configuration -> Advanced -> Email Client
- Add the new inbound email address to "Inbound email address"