Is there any API methods to retrieve the email body sent using Transactional Email API?

Deepu
Participant

Hi folks,

 

I am looking forward to retrieving the email body sent using Single Send API.


I have figured that subject lines will be available in the email events associated with the 'SENT' event.

 

It would be great if someone can point out the API methods which will have to the real email body sent out to customers in the response. 

 

Thanks in advance.

0 Upvotes
6 Replies 6
dennisedson
Community Manager

hello @Deepu ,

Apologies for slow response!

Have you figured this out, yet?  

 

If not, going to tag a couple community members in here who could possibly help

 

@jpsanchez , @HenryCipolla !  Hey! could you all take a quick look at this?

 

Thanks so much

 

Thanks,

Dennis


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
0 Upvotes
Deepu
Participant

@dennisedson No, I am yet to find out a solution to this.

0 Upvotes
HenryCipolla
Member

Deepu, I believe you want the Engagements API:

 

https://legacydocs.hubspot.com/docs/methods/engagements/engagements-overview

 

It's a little bit challenging to work with because differential updates only work if you volume is low enough. This is what it returns for individual emails:

"metadata": {
    "from": {
    // The details of the sender
      "email": "email@domain.com",
      // String; the email address of the sender
      "firstName": "First",
      // String; The first name of the sender
      "lastName": "Last"
      // String; The last name of the sender
    },
    "to": [
    // The details of the recipient
      {
        "email": "contact name <test@test.com>"
        // String; the email address of the recipient 
      }
    ],
    "cc": [],
    // A list of details for anyone cc'd on the email.
    "bcc": [],
    // A list of details for anyone bcc'd on the email.
    "subject": "This is the subject of the email",
    // String; The subject of the email
    "html": "<div>This is the body of the email</div><div><br></div><div>-Me</div>",
    // String; The body of the HTML email
    "text": "This is the body of the email\n\n-Me"
    // String; The body of the text-only email.
}

 

Deepu
Participant

@HenryCipolla Thank you for your response. 

 

It looks like we are not on the same page. Here is the use-case we are trying to integrate.

 

We have created many campaigns in our account. The emails to customers for these campaigns are sent using 'Single Send' Transactional Email API. I am trying to retrieve the mail body sent through these emails. 

 

Please let me know if the Engagements APIs can be made use in this case. If so can you please explain how to relate the engagement with the sent email event. Or is there any APIs to integrate the above use-case.

0 Upvotes
HenryCipolla
Member

Hi Deepu, I understand the rqeuest. The only way I know of to get email content is through the Engagements API. This contains interactions with a Contact, including emails sent to them.  What I'm not certain about is whether or not Engagements contain the transactional emails or not (marketing campaign emails for example don't appear in that list). But it's pretty quick to find out. Send yourself a transactional email and then use the recent Engagments API to see if you see it:

 

https://legacydocs.hubspot.com/docs/methods/engagements/get-recent-engagements

 

As for how you find it, each record in engagements has the associated Contacts so that will be the easiest way to find the emails you sent.

Deepu
Participant

Thank you @HenryCipolla. I realize all the emails can be read using Engagements API.

 

I will try the APIs and let me see if there is any way to relate the engagements to the campaign emails or single send transactional emails.

0 Upvotes