The documentation for creating emails using Mautic API is: https://developer.mautic.org/#create-email
I can not create an email without specify the parameter lists. The lists parameter is specified like this:
lists array Array of segment IDs which should be added to the segment email
How can I send the parameter lists via HTTP post using Python so that Mautic API can undestand it?
This creates a email of type "template" (default) in Mautic...
emailData = {
'name': 'Email-teste',
'subject': 'Assunto teste',
'isPublished': '1',
'language': 'pt_BR',`enter code here`
'customHtml' : '<strong>html do email<strong>'
}
But what I need is to create an email of type "list".
For that, it is mandatory to specify each list ids. Lists are the segments in Mautic.... I have a segment with ID 7!
How can I send the segments IDs to Mautic API using POST (Python requests)?
emailData = {
'name': 'Email-teste',
'subject': 'Assunto teste',
'emailType': 'list',
'lists': '7',
'isPublished': '1',
'language': 'pt_BR',
'customHtml' : '<strong>html do email<strong>'
}
I tried many ways... and I always get the errror:
u'errors': [{u'code': 400,
u'details': {u'lists': [u'This value is not valid.']},
u'message': u'lists: This value is not valid.'}]}
I am sure I have a segment with ID 7, as I can see in Mautic interface.
I am using a modified version of https://github.com/divio/python-mautic