Incoming webhooks are one of the most powerful options a piece of software can offer you. And we're proud to say we're probably the only email-marketing platform that gives you access to incoming web-hooks.
Here is how to use incoming webhooks in Emercury
1) Head on over to settings on your top right and choose "Developer"
2) Once inside you will see a webhooks section, just click on the add button
3) Choose the incoming option
4) Fill in the fields on top
From "list" choose the list where you want to add subscribers to
In "name" give the webhook a name
Set the status to "Active"
Next, you want to send some test data to the hook and then map it to the appropriate fields.
This is so that Emercury knows what kind of data to expect and how to process it. To do so you will need to do 3 things:
1) Click on the start listening button
This will trigger a screen that informs you it is waiting for data
2) Using an HTTP request send test data (in JSON format)
To get the webhook URL click on copy to clipboard under URL:
For authentication include an "emercury-api-key" header, and for the value place your Emercury key. Note that this is different than your API key. To copy the Emercury key click on the "copy to clipboard" button under the Emercury Key field
In the body of the request include a well-structured JSON file. For our example we will use a very simple JSON like so:
4) Check if the data was received as intended
If you've done the previous step where you clicked listen, and sent an HTTP request with a JSON body, you should now see this blue button that says "show data structure".
If you click on the "show data structure" button, you should see the root of a structure tree. This is based on the JSON that we sent during the listen.
If you click on it you can see the branches and look at each one individually. In this image we clicked to unfold the "first_name" and we see that Emercury received the correct value in the correct way.
5) Map the values to the appropriate fields
Scroll down until you see the full list of fields in your Emercury account. This includes both default and custom fields.
Choose the field in which you want to insert received data. For example you might click on the email field to select it
Then, from the box of values on the right, simply click on the appropriate test value from the list of received values. In our example we need to select the test value received for the email key.
Note that we simply clicked on the "email@example.com" and it automatically performed the correct mapping to the email field.
Also note, that obviously this value is dynamic. The mapping tool on the bottom right is currently showing "firstname.lastname@example.org" for your convenience as that was the email that we sent in the test data.
However, when you click on that email address it doesn't actually insert "email@example.com" in the field you choose to map to (shown in red). It inserts "root:email" as the value for the field that you are mapping for.
This tells Emercury that whenever you send another JSON to this hook, it should take whatever value is defined under the "email" key, and put it into this new subscriber's email field.
You then repeat this process for the other fields, and in our example the end result will end up looking like this
That's it! Very simple!
This opens up a ton of exciting opportunities for you as you can now instantly send values to Emercury from any other tool if it supports sending values to a webhook.
Note: If you don't have a developer background or understand the basics of HTTP and sending data to webhooks, don't worry.
We will soon have tutorials on how you can send data using some of your favorite tools. You can send data from to Emercury from any of your tools that have an option to send data to a webhook, or use a general integration tool such as Zapier or Integromat.