-
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.
- 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.
If you do not need to send mail with SparkPost, you do not have to fill in the sending domain when prompted.
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 Mandrill. 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.
SparkPost does not have a UI in their dashboard to register the subdomain.
However, they do have a web console. Follow these steps to register your subdomain with SparkPost.
- Go to:
https://developers.sparkpost.com/api/#/reference/inbound-domains/create-and-list/create-an-inbound-domain - On the right sidebar, click on "Switch to Console".
- Under "Body", for the
domain
field, type in the subdomain you created in step 2. - Click on "Headers". Under the
Authorization
field, type in the API key you created in step 1. - To register your subdomain, click on the green
Call Resource
button. - After you click on the
Call Resource
button, scroll down and ensure that the request did not return any errors. If the request did not get any unauthorized errors, your subdomain is registered with SparkPost.
SparkPost does not have a UI in their dashboard to register an inbound webhook.
However, they do have a web console. Follow these steps to register your webhook with SparkPost.
- Go to:
https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/create-a-relay-webhook - On the right sidebar, click on "Switch to Console".
- Under "Body":
- 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 is optional, but is useful if you want additional security when parsing webhook responses from SparkPost. - For the
domain
field, enter the subdomain you created in step 2.
- For the
- Click on the "Headers" tab. Under the
Authorization
field, type in the API key you created in step 1. - To register your subdomain, click on the green
Call Resource
button. - After you click on the
Call Resource
button, scroll down and ensure that the request did not return any errors. If the request did not get any unauthorized errors, your webhook is registered with SparkPost.
(optional) If you entered an auth_token
in point 3, 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!