I just tried to update an email subject line via the API and got the following error:
"message": "API only allows operations on emails with a template"
I mean - it's pretty clear in the message itself - but I just wanted to double check that it wasn't possible to update anything in an email when it doesn't have a template. This would be quite annoying - we don't really use email templates in Marketo and instead create them in Dreamweaver, then copy the code in. So virtually none of our emails are attached to a template.
I'm hoping there's a solution here since there are 250ish emails I need to update...
The API doc (http://developers.marketo.com/rest-api/assets/emails/ ) is quite clear about the fact that emails can be created and update only from a source template, unfortunately.
But there is another endpoint that enables you to replace the full HTML : http://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Emails/createE...
have you tried it ?
No I wasn't aware of that endpoint....seems quite handy! Forgive my naivety...but is it possible to update subject lines using that endpoint? Updating the HTML is useful, but in this particular circumstance I need to replace subject lines.
As a secondary question, that endpoint requires a "multipart file". What is that and how would I implement it?
Use this other endpoint to change the email header : http://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Emails/updateE...
The multipart email is the format that enables you to include both the HTML and text version. The standard is here :RFC1341(MIME) : 7 The Multipart content type and some much easier information from Litmus: Improve Your Spam Score With Multi-Part Emails —Litmus Software, Inc.
Unfortunately that's the original endpoint I was using, which gives me the error above....so it seems there is no way to update the subject line unless the emails are in a template then? That other endpoint is useful, but without the ability to modify subject lines via API I can't solve my original problem
Would be perfect....but unfortunately all of these emails were set up with hardcoded subject lines So unless I go through and replace them all with tokens (which is future-proofed, but still time-consuming) I'm out of luck...
Ah well. Time to bite the bullet I think. Folder level token, then update every subject line manually to be that token. At least it's one update if it ever needs changing again.
Ah, to have set this up when I was older and a bit wiser....
Thanks for your help all.