Programatically break an email from a template?

Anonymous
Not applicable

Programatically break an email from a template?

We are looking to sync emails directly via the API, but template is a required field.


In my head, I have the following kludge in mind:

  1. Create Template, return template ID
  2. Approve Template
  3. Create Email from Template
  4. Approve Email
  5. Unapprove Template
  6. Delete Template

The problem is that a template cannot be deleted while there are emails attached to it. By editing the code of an email outside of editable elements in the Marketo UI, it breaks it from the template. Is there a way to do this programatically? I don't want to fill up instances with 1:1 Templates to Emails.

David Everly

6 REPLIES 6
Dory_Viscoglio
Level 10

Re: Programatically break an email from a template?

Hey Jason, in the past we've done this via a blank template. It requires that you have the API provide all of the code for the subsequent email, but it was a simpler solution than what you've outlined here.

Anonymous
Not applicable

Re: Programatically break an email from a template?

The only issue I see here is that I need to pass the entire email, not just the contents of an editable area; the <head> contains different information for each email.

SanfordWhiteman
Level 10 - Community Moderator

Re: Programatically break an email from a template?

What if you tokenize those areas in the <head>?

Anonymous
Not applicable

Re: Programatically break an email from a template?

The emails need to stand on their own, so tokens don't apply...but maybe variables could work. An ugly workaround for sure, but maybe I can pursue it.     

Anonymous
Not applicable

Re: Programatically break an email from a template?

Anyone from Marketo care to chime in?          

Grégoire_Miche2
Level 10

Re: Programatically break an email from a template?

Hi Jason,

Have given a look to the endpoint that enables to update editable sections specifically: http://developers.marketo.com/rest-api/assets/emails/#update_editable_section

-Greg