Email routers
Last updated
Was this helpful?
Last updated
Was this helpful?
An email router plugin is a that can be associated to a send email node in an automation, allowing you to manage the connection with an external email router.
If you don't know what a plugin is, you can find
Email routers need to implement two endpoints.
POST
myworker/v1/email_routing
This endpoint is called any time a user goes through a send email node in an automation.
data
object
PluginEmailData. See Email renderer.
content
object
PluginEmailContent. See Email renderer.
meta
object
PluginEmailMeta. See Email renderer.
user_identifiers
object
The available user identifiers for the user.
datamart_id
string
The ID of the datamart.
blast_id
string
The ID of the campaign blast.
campaign_id
string
The ID of the campaign.
creative_id
string
The ID of the email template.
context
string
The email call context. One of LIVE
, STAGE
or PREVIEW
.
call_id
string
The email call ID.
email_router_id
string
The ID of the email router plugin instance. Used to retrieve the instance properties.
POST
/v1/email_router_check
The endpoint is called before sending an email to do preliminary checks. In particular, to check if it is possible to send an email with the provided identifiers.
user_identifiers
object
The available user identifiers for the user.
email_router_id
string
The ID of the email router plugin instance. Used to retrieve the instance properties.
GET
https://api.mediarithmics.com/v1/email_routers/:id/properties
Get the properties associated with the email router plugin instance.
id
string
ID of the email router plugin instance, typically theemail_router_id
from the incoming request.
An email router plugin has the EMAIL_ROUTER
plugin type. Its group id should be {domain.organisation.email-router}
(for example com.mediarithmics.email-router
).
Its artifact id should be the name of the email router plugin, i.e. example-email-router
.
We can provide you with a "Hello World" project using our SDK. Please contact your support in order to have access to it.
Your should extend EmailRouterPlugin
class and implement the onEmailRouting
and onEmailCheck
functions from the plugin SDK.
The onEmailRouting
function is called every time a user runs through a send email node in an automation. It is responsible for sending the email.
Don't forget to catch your errors. You should log / respond with the appropriate message to facilitate debugging.
See to learn why you should use the email_router_id
parameter to retrieve the instance properties.
The code of the email router can call the following API endpoint to retrieve.
See the documentation to see .
Use our to create your email router plugin in Node.js: the required routes are already defined and you only have to override specific functions.
You can find a sample email router plugin .
The project structure and files work as .
You can monitor email router plugins.