APIs & Integrations

ymnagano
Member

Uploading custom email templates using the API

SOLVE

What, if any, is the most straight forward way to upload custom email templates to my HubSpot account?

For context, my company already uses HubSpot for a number of marketing emails, but we are about to migrate a large number of 'engagement'-type emails from a separate email service (Mandrill) over to HubSpot to be hosted and sent from.

Using Mandrill, we are able to store, edit and upload email templates from our server. Their node package has a function, 

mailchimpClient.templates.add(), that accepts an options object that includes the template code to be directly, uploaded. Is it possible to closely replicate this experience in HubSpot? 

HubSpot appears to offer a few possible ways to upload custom templates using its API, but I haven't so far been able to get any of them working as I would expect.

I've tried both node package functions and direct http requests, including:
• hubspotClient.crm.objects.emails.basicApi.create()
POST/files/v3/files
• POST /content/api/v2/templates

Ideally, I'd like to be able to upload custom templates directly to our Marketing Emails in HubSpot to then be able to be sent via a request via the Single Send API. If that's not possible, what is the best way to be able to still write, edit and upload custom templates from our server? In other words, we want to retain control of our template design.
0 Upvotes
1 Accepted solution
Indra
Solution
Guide | Elite Partner
Guide | Elite Partner

Uploading custom email templates using the API

SOLVE

@BérangèreL, thanks for mentioning. You are correct according the info you already shared about the API.

 

@ymnagano, HubSpot has 2 ways of setting up a email. They have the drag and drop email editor. This is a nice feature for the user to create email templates without coding. 

 

They also have the clasic editor for email. Here you can create custom template/modules for setting up emails.

 

If you want to migrate templates you have to use the clasic editor. It's less user friendly for the user to manage or change. But it has options to import using CLI to create new files or using the API for Templates to create new templates.

 

The drag and drop email editor doesn't have any export or import options. So that's no option.


Indra Pinsel - Front-end developer - Bright Digital
Did my answer solve your issue? Help the community by marking it as the solution.

View solution in original post

3 Replies 3
pragna-tops
Participant

Uploading custom email templates using the API

SOLVE

Hello, I have used APIs for creating email template and then when I try to use the template id for single-send-api then it is not working. 

 

My requirement is only that I create template via API and can send same as single-send-mail. 

Can anyone please guide me? Thanks in advance!

0 Upvotes
Indra
Solution
Guide | Elite Partner
Guide | Elite Partner

Uploading custom email templates using the API

SOLVE

@BérangèreL, thanks for mentioning. You are correct according the info you already shared about the API.

 

@ymnagano, HubSpot has 2 ways of setting up a email. They have the drag and drop email editor. This is a nice feature for the user to create email templates without coding. 

 

They also have the clasic editor for email. Here you can create custom template/modules for setting up emails.

 

If you want to migrate templates you have to use the clasic editor. It's less user friendly for the user to manage or change. But it has options to import using CLI to create new files or using the API for Templates to create new templates.

 

The drag and drop email editor doesn't have any export or import options. So that's no option.


Indra Pinsel - Front-end developer - Bright Digital
Did my answer solve your issue? Help the community by marking it as the solution.
BérangèreL
Community Manager
Community Manager

Uploading custom email templates using the API

SOLVE

Hi @ymnagano,

Great question, thanks for asking the Community!

I'd like to share similar threads and resources that might help you:

- Create a new Template
- CMS API Templates

- The solutions from @stene and @alyssamwilie on this post "upload your own HTML/CSS code for email template"
- Build a custom coded template
- The solution from @Ben_M on this post "Importing a template into Hubspot"

I'd like to invite a couple of subject matter experts to this conversation: Hi @Indra, @Teun and @Anton do you have suggestions to help @ymnagano, please?

Also, if anybody else has anything to add and/or share, please feel free to join in the conversation 🙂

Thanks a lot and have a lovely day!

Best,
Bérangère


Saviez-vous que la Communauté est disponible en Français ?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings!