Skip to content
r-a-y edited this page Feb 27, 2016 · 4 revisions

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.

Things we're going to do:

  1. Create an account at sparkpost.com and an API key.
  2. Set up a new subdomain that is used exclusively by SparkPost. eg. reply.example.com.
  3. Add SparkPost's MX records to this subdomain.
  4. In SparkPost, register the subdomain.
  5. In SparkPost, register the webhook.
  6. Install the master branch of RBE (1.0-RC4 or later) and add the subdomain to RBE's settings page.

Installation instructions:

1) Create an account at sparkpost.com and an API key.

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:

  1. Login to the SparkPost dashboard.
  2. Go to Account > API Keys.
  3. Click on New API Key.
  4. Under API Key Name, give it a name that you can identify with your site.
  5. Under API Permissions, select:
    • Inbound Domains: Read/Write
    • Relay Webhooks: Read/Write
  6. Save by clicking on Add API Key.
  7. 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.

2) Create a subdomain at your domain registrar's dashboard

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.


3) Add SparkPost's MX records for your new subdomain

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.


4) In SparkPost, register the subdomain.

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.

  1. Go to:
    https://developers.sparkpost.com/api/#/reference/inbound-domains/create-and-list/create-an-inbound-domain
  2. On the right sidebar, click on "Switch to Console".
  3. Under "Body", for the domain field, type in the subdomain you created in step 2.
  4. Click on "Headers". Under the Authorization field, type in the API key you created in step 1.
  5. To register your subdomain, click on the green Call Resource button.
  6. 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.

5) In SparkPost, register the webhook.

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.

  1. Go to:
    https://developers.sparkpost.com/api/#/reference/relay-webhooks/create-and-list/create-a-relay-webhook
  2. On the right sidebar, click on "Switch to Console".
  3. 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.
  4. Click on the "Headers" tab. Under the Authorization field, type in the API key you created in step 1.
  5. To register your subdomain, click on the green Call Resource button.
  6. 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.


6) Install and configure RBE on your WordPress site
  1. Download the latest master branch of RBE - https://github.com/r-a-y/bp-reply-by-email/archive/master.zip
  2. Extract the plugin to /wp-content/plugins/.
  3. Login to the WP admin dashboard and activate RBE. Next, navigate to BuddyPress > BP Reply By Email.
  4. 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.
  5. 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!
Clone this wiki locally