-
Notifications
You must be signed in to change notification settings - Fork 9
SparkPost
As of v1.0-RC4, RBE supports SparkPost as an inbound provider.
For more on inbound email, read the corresponding ticket - https://github.com/r-a-y/bp-reply-by-email/issues/46.
This guide requires knowledge of how to send POST requests via either cURL or using an app like Postman to communicate with the SparkPost API.
If you are not a developer, please choose a different inbound provider listed in the Starter Guide.
- Create an account at sparkpost.com and an API key.
- Set up a new subdomain that is used exclusively by SparkPost. eg.
reply.example.com
. - Add SparkPost's MX records to this subdomain.
- In SparkPost, register the subdomain.
- In SparkPost, register the webhook.
- Install the master branch of RBE (1.0-RC4 or later) and add the subdomain to RBE's settings page.
SparkPost also has their own help article that you can also refer to for steps 1-5:
https://support.sparkpost.com/customer/portal/articles/2039614-enabling-inbound-email-relaying-relay-webhooks
Create an account at SparkPost.
You'll need to complete the entire "Getting Started" section after you have registered your account. A detailed guide can be found here:
https://www.sparkpost.com/docs/getting-started/getting-started-sparkpost
IMPORTANT: If you do not plan on sending email with SparkPost, you still need to create and verify a sending domain as well as sending out at least one email with SparkPost per month in order to keep your account active
Once you have created your account, we need to create a dedicated API key for inbound email:
- Login to the SparkPost dashboard.
- Go to
Account > API Keys
. - Click on
New API Key
. - Under
API Key Name
, give it a name that you can identify with your site. - Under
API Permissions
, select:- Inbound Domains: Read/Write
- Relay Webhooks: Read/Write
- Save by clicking on
Add API Key
. - This will show your API key. Make sure you save this key so we can reference it later as SparkPost only shows the API key once.
Login to your domain registrar's dashboard and create a new subdomain.
Let's say example.com
is your WordPress site, you'll want to create a dedicated subdomain used only by SparkPost. eg. reply.example.com
. Change reply
to whatever suits your fancy. This will be used in emails for the Reply-To
email header - [email protected]
- so choose carefully.
SparkPost requires the following MX records to be set for your subdomain:
- rx1.sparkpostmail.com - priority 10
- rx2.sparkpostmail.com - priority 10
- rx3.sparkpostmail.com - priority 10
Quoted from https://developers.sparkpost.com/api/#/reference/inbound-domains
Configure your subdomain to use these records in your domain registrar's dashboard.
As of writing, SparkPost does not have a UI in their dashboard to register a subdomain.
-
Ensure that you are familiar with the SparkPost API:
https://developers.sparkpost.com/api/index.htmlParticularly, setting the
Authorization
header to the API key we created in step 1. -
Use the following API call:
https://developers.sparkpost.com/api/inbound-domains.html#inbound-domains-create-and-list-post
As of writing, SparkPost does not have a UI in their dashboard to register an inbound domain webhook.
-
Ensure that you are familiar with the SparkPost API:
https://developers.sparkpost.com/api/index.htmlParticularly, setting the
Authorization
header to the API key we created in step 1. -
Use the following API call (all parameters are required):
https://developers.sparkpost.com/api/relay-webhooks.html#relay-webhooks-create-and-list-post- For the
name
field, type in a name that you can identify with your site. - For the
target
field, type in the URL to your WordPress install. - For the
auth_token
field, type in a unique passphrase. This can be used to verify that POST responses are coming from SparkPost. - For the
domain
field, enter the subdomain you created in step 2.
- For the
(optional) If you entered an auth_token
in point 2, open wp-config.php
and add the following line:
define( 'BP_RBE_SPARKPOST_WEBHOOK_TOKEN', 'THE STRING YOU ADDED FOR AUTH_TOKEN' );
This will increase security to ensure that webhook responses were actually sent from SparkPost.
- Download the latest master branch of RBE - https://github.com/r-a-y/bp-reply-by-email/archive/master.zip
- Extract the plugin to
/wp-content/plugins/
. - Login to the WP admin dashboard and activate RBE. Next, navigate to BuddyPress > BP Reply By Email.
- Do the following:
- For Mode, select
Inbound Email
. - For Provider, select
SparkPost
. - For Inbound Domain, type in the subdomain in step 2. Save the settings.
- For Mode, select
- Now test out RBE! At-mention someone on the frontend and try to reply to that person via email. See if a reply is sent back. If you are able to reply to one another, RBE is working!