APIs & Integrations

JupiterSinton
Member

Replies to emails sent using the SMTP API

Hi,

My company is looking to integrate with HubSpot. While some people will be using the Service Hub to work tickets, others are required to use our in-house system. Tickets will need to be passed back and forth between Service Hub and in-house system users, with updates syncing on both systems. Responses from customers will need to come from the HubSpot inbox connection.

It's my understanding that we will need to use the SMTP API to email customers. However, I'm unsure how email threading will work, and how we can ensure that customer replies are threaded onto the correct HubSpot ticket. A ticket journey might look like the following:

  1. Customer emails in - HubSpot ticket 123 is created in HubSpot and duplicated into our in-house system via API.
  2. Agent A corresponds with customer on HubSpot ticket 123 using HubSpot - all correspondence (sent and received) is pulled onto the copy of the ticket in our in-house system via API.
  3. Agent B then contacts customer on HubSpot ticket 123 using our in-house system - emails are sent using the SMTP API and logged onto HubSpot ticket 123 using the Engagements API.
  4. Customer responds to an email sent by Agent B (sent to customer using the SMTP API and logged onto HubSpot ticket 123 using the Engagements API).

We want step 5. to be that the customer's response is threaded onto the existing ticket (HubSpot ticket 123). At the moment, I believe that what will actually happen is the customer's response will cause another ticket to be created (as tickets don't thread based on the contact), but I'm not sure.

 

Can anyone please confirm whether replies to emails sent by the SMTP API will thread onto an existing ticket? If so, how do we ensure they thread onto the correct ticket? If not, how can we do this?

 

Cheers

0 Upvotes
3 Replies 3
rowanreid
Participant | Elite Partner
Participant | Elite Partner

Replies to emails sent using the SMTP API

Email threading is handled by email clients through a variety of mechanisms, one of which being the MESSAGE-ID / RESENT-MESSAGE-ID headers.  Perhaps when you send the emails via the SMTP API you could include the ID from the previous email in these headers and HubSpot would then continue the threading when the response is recieved?

This is just a guess, I have not tried this in practice.

malcolm1
Member | Gold Partner
Member | Gold Partner

Replies to emails sent using the SMTP API

Sorry, I haven't done anything that required stapling emails to tickets in that way. My standard experimental method is to create lots of tasks in Postman and then chain them together. Doing that gives you something akin to step-by-step debugging and lots of feedback. 

dennisedson
HubSpot Product Team
HubSpot Product Team

Replies to emails sent using the SMTP API

Hello @JupiterSinton 

That is a very interesting question!

Going to tag in a few people who might have some thoughts on this

@rowanreid , @himanshurauthan , @malcolm1 what are your thoughts on this scenario?

 

0 Upvotes