0

We currently have a python script that generates an HTML template and uploads it to Marketing Cloud's Classic Content product, via FuelSDK:

  my_client = FuelSDK.ET_Client()
  email = FuelSDK.ET_Email()
  email.auth_stub = my_client
  email.props = {"CustomerKey": datetime.now(),
                  "Name": email_sender_name,
                  "Subject": subject_line,
                  "HTMLBody": email_body.decode('utf-8'),
                  "EmailType": "HTML",
                  "IsHTMLPaste": "true"}
  try:
    response = email.post()

As Classic Content is being retires, what is the equivalent approach for getting a basic HTML email into Content Builder?

I assume that it's the REST API, but it's a little unclear what is supported. Anyone make this transition and have advice?

1

This can be achieved using the Content Builder REST API. Here is an example taken from the documentation:

{
    "name": "my first message",
    "channels": {
        "email": true,
        "web": false
    },
    "views": {
        "html": {
            "content": "<!DOCTYPE html><body>This is a simple html paste email.</body></html>"
        },
        "text": {},
        "subjectline": {},
        "preheader": {}
    },
    "assetType": {
        "name": "htmlemail",
        "id": 208
    }
}

The correct endpoint is POST /asset/v1/content/assets.

Further reading:

| improve this answer | |
  • Awesome, thank you Markus! – wryfi May 6 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.