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 Answer 1

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:

1
  • Awesome, thank you Markus!
    – wryfi
    May 6, 2020 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .