Solved

How to get transactional emails in the timeline?

  • 27 April 2023
  • 5 replies
  • 87 views

Badge +1
  • we send transactional emails through our own systems (for example, a confirmation email)
  • we would like to be able to see the actual email in the timeline (not as a property or an object, but as an actual email sent to the customer)

Does anyone have a solution for this? Ideally we can avoid having to change the sender of our confirmation emails to be kustomer-related, we would prefer to keep that within our own app.

icon

Best answer by Anonymous 27 April 2023, 21:44

View original

5 replies

Hi @claire.gibbons, to accomplish this you would need two things:

  1. A way to receive these events (messages) in Kustomer.
  2. A workflow to ingest the events sent to Kustomer.

Regarding the first point, would it be possible to send these messages to a Kustomer Email hook as a BCC on the email? Email hooks provide a way to email real-time information to Kustomer via a unique email address. Here is an article from our KB on Inbound Hooks, specifically email hooks: link

Alternatively, depending on the way your internal system functions, these events could be sent to a webhook. Webhooks are a URL that provides a way for an application to send Kustomer information. This requires the application to POST data to the webhook URL so Kustomer can read the data using a Kustomer API key.

Once the data of the messages are being sent to Kustomer, a workflow is needed to ingest the events and create messages on the customer’s timeline, or create a customer if it does not exist and then create the message on the newly created timeline.

Here’s an article from our KB on ingesting data to Kustomer using a workflow and inbound hook: link

Badge +1

Hi @nate.skiles thank you for your reply! Actually I tested sending to a Kustomer email on bcc (not using webhooks, i simply sent an email to my own customer & bcc’d a kustomer email), and it did not show up on my timeline.

 

I am not following how a workflow would solve this - it sounds like you are suggesting i basically reconstruct the email in Kustomer, by sending the email data and then creating a message using that data. Is that right?

Badge +1

@nate.skiles I think I follow now...I will try the email webhook workflow. Thank you again!

Badge +1

alrighty...so I was able to set up the webhook and workflow no problem. The part I’m not understanding still is your suggestion to create a message. The email itself was already sent to the customer, so I don’t want to re-send anything. And then I also want the actual email to be visible in kustomer, not just a note that it got sent. How would I do that?

Hi @claire.gibbons, regarding your first post, what likely happened is the message was added to a timeline associated with the email address that sent the message from your system. Sending it to the Kustomer email would ingest as though the sender was a customer reaching out, as opposed to being an outbound message to the customer you reached out to.

Using the “Message Create” step in a workflow doesn’t send a message to the customer, it just creates a record in Kustomer for the message that was sent. There are actions that do send messages in a workflow, those would be the either the Postmark or Gmail message send actions, or the chat message send action, but the Kustomer Message Create action will not send a message.

You can add the data below from an example Email Hook event to your “Example Webhook Data” section of the workflow trigger, seen here. This will allow you to more easily map data from the message to your message create step. For example, you would map the “htmlBody” attribute to the message body attribute in the message create step.

{
"id": "9bb5189e2242f729c0e2e56d",
"type": "transaction",
"attributes": {
"createdAt": "2023-04-27T21:21:37.724Z",
"data": {},
"email": {
"externalId": "8554121d-7d57-4bb2-acc3-7dcd5e2a4f54",
"from": {
"email": "xxxx@kustomer.com",
"name": "Nate Skiles",
"mailboxHash": ""
},
"to": [
{
"email": "xxxxxxxxxxxx@hooks.kustomerapp.com",
"name": "Email Hook Name",
"mailboxHash": ""
}
],
"cc": [],
"bcc": [],
"textBody": "test\n-- \n<https://www.kustomer.com/?utm_source=signature&utm_medium=email&utm_campaign=home>\n\nNathan Skiles | Technical Support Engineer\n",
"htmlBody": "<div dir=\"ltr\"><br clear=\"all\"><div>test</div><span class=\"gmail_signature_prefix\">-- </span><br><div dir=\"ltr\" class=\"gmail_signature\" data-smartmail=\"gmail_signature\"><div dir=\"ltr\"><a href=\"https://www.kustomer.com/?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=home\" target=\"_blank\"><img src=\"http://go.kustomer.com/rs/049-QDZ-838/images/EmailSigLogo_Kustomer.png\" width=\"200\" height=\"33\"></a><br><div><span><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:0pt\"><span style=\"font-size:11pt;font-family:Poppins,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap\">Nathan Skiles </span><span style=\"font-size:11pt;font-family:Poppins,sans-serif;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap\">| Technical Support Engineer </span></p><p dir=\"ltr\" style=\"line-height:1.38;margin-top:0pt;margin-bottom:0pt\"><br></p><div><br></div></span></div></div></div></div>\n",
"subject": "test",
"replyTo": "",
"recipient": {
"email": "xxxxxxxxxxx@hooks.kustomerapp.com",
"mailboxHash": ""
},
"sentAt": "2023-04-27T21:21:25.000Z"
}
}
}

 

 

I would recommend sending a few tests with the email hook BCC’d to get a better idea of how the data is flowing into the workflow. Here’s a blog post from one of my teammates walking through how to parse workflow log data:

I hope this helps!

Reply