APIs & Integrations

Cristina2
Member

automated emails to use in workflows via the API

Hi there!

 

How can we create automated emails to use in workflows through API?

In this link it is explained how to do it in the UI: https://knowledge.hubspot.com/email/create-automated-emails-to-use-in-workflows.

 

What we have tried so far:

1. We can create marketing emails, we can publish it by setting field “ispublished” to "true". The email has state “AUTOMATED_DRAFT” on creation. We get the email ID.

2. Then, we update the field "state" to "AUTOMATED". In the UI I can see the email published and I can send a test email.

3. We try to create a workflow via the API with action "type" “email“ and "emailContentId"email ID got in step 1)

 HERE
We were getting 500 ERROR type even though today we tried again and I can see a new error "EMAIL_NOT_PUBLISHED_FOR_AUTOMATION". 
Can you please let us know how to solve this?
 
Thank you in advance for your assistance!
 
Best regards,
Cristina
0 Upvotes
5 Replies 5
DorL
Participant

automated emails to use in workflows via the API

Hi @Cristina2 We're working towards achieving a similar flow. Have you figured out a solution for this?

0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

automated emails to use in workflows via the API

Hi @Cristina2 

 

Would the Transaction Emails work for you?

 

It's an [in my opinion expensive] add-on but it may be easier to do what you need to do?

 

Mike

Cristina2
Member

automated emails to use in workflows via the API

Hi @Mike_Eastwood,

 

We analysed the Transactional Emails too but currently, it does not suit our needs. 

Thank you for the suggestion anyway!

 

Cristina

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

automated emails to use in workflows via the API

Hi @Cristina2 

Have you tried to create this worflow via the UI and then get it via the API so you can see the structure?  That is usually my method 😀

@Mike_Eastwood is a pro at things like this and might be able to lend a hand!

 

0 Upvotes
Cristina2
Member

automated emails to use in workflows via the API

Hi @dennisedson,

 

Yes, we did create the workflow in the UI and then query using the API to check the data. After all, the issue was in the email publish status.

Technically, we could publish the email and see it in the UI as published but currently, it is not allowed to publish via API.

 

Cristina

0 Upvotes