Email Callback API Tutorial

Intro

We offer you the ability to send all automatic emails meant for contacts to your own server via a callback URL, instead of sending the email through our email infrastructure. By sending the emails via your own email server infrastructure or helpdesk system, you get total control over the sender identity and the return path.

Enable email callback URL

  1. Go to the email callback API settings under **Chat > Advanced**.
  2. Check the **Custom email API** box

Request documentation

Type Value Description
Request Method POST
Request Header API-SECURITY-TOKEN Contains your custom security token
Request Body JSON

JSON body

Name Type Description
html String HTML version of the email body
receiver String Email address of the recipient
subject String Subject of the email
text String Raw text email
email_type String The type of email Userlike sends, it’s either "transcript" or "reauth"
context String Important information that the email contains. Each email_type has its own context, scroll down to **Transcript context** and **Reauth context** to learn more

An example of a message object:

Transcript context

Transcript emails contain all messages sent during a Conversation as well as survey answers, feedback, ratings and other Conversation events. Their email_type is set to "transcript".

Name Type Description
messages Array An array of all messages sent during a Conversation. Each message is an object

Reauth context

Reauth emails contain a link and a token with which contacts can authenticate themselves.

Name Type Description
reauth_link String A link that authenticates your contacts when they click on it. Note that the link can be missing if no inbound URL is defined in the Widget’s settings.
reauth_token String A token that contacts can enter in the Widget to authenticate, for example when no reauth link is displayed