Search code examples
pythondjangocampaign-monitorcreatesend

How to make HTML imported Campaign Monitor templates editable?


During the import procedure I made sure to mark the imgs editable, and put several content sections into multiline constructs. The imported templates show up in the client's template set, but when I try to edit them, I only presented with the zip/HTML upload option instead of the actual editor:

enter image description here

From my code base, my own template object has the exporting code:

class EmailBodyTemplate(models.Model):
...
    def migrate_email_template(self, cm_client_id, cm_token):
        cm_template = Template(cm_token)
        # Basically I expose a specially tailored HTML version of my template
        # for CM: adding editable to imgs, introducing multiline wrappers and
        # adding unsubscribe, view in browser and other special links
        html_url = settings.HOME_URL + reverse('email_import_view', args=(self.id,))
        template_id = cm_template.create(cm_client_id, self.name, html_url, None)
        self.template_id = template_id
        self.save()

Solution

  • I reached out to Campaign Monitor support on the matter, and got the info that their editor is not applicable for imported HTML templates from an external source. In that case you need to keep editing those outside of the system and re-upload after edit.