Is there a programmatic way to create a Triggered Send Data Extension (using Python Fuel SDK)? When I am creating an extension using the same required fields "SubscriberKey", "EmailAddress" as in the GUI "Triggered Send Data Extension" template (see code below), my data extension is not as good as GUI-created from that template and does not show up in "Triggered Emails".
def create(de_name='', de_columns={}, sendable_field=None):
print("*** Creating Data Extension '{}'".format(de_name))
de = ET_Client.ET_DataExtension()
de.auth_stub = ET_Client.ET_DataExtension()
de.props = {
"Name": de_name,
"CustomerKey": de_name
}
if sendable_field: # not empty
de.props.update({
"IsSendable": True,
"SendableDataExtensionField": {
"Name": sendable_field
},
"SendableSubscriberField": {
"Name": "Subscriber Key" # Why the hell it works ONLY with a SPACE???
}
})
de.columns = de_columns
response = de.post()
util.all_info(response)
def create_tsde():
de_name = 'foo'
de_columns = [
{
"Name": "SubscriberKey",
"FieldType": "Text",
"MaxLength": 254,
"IsRequired": True
},
{
"Name": "EmailAddress",
"FieldType": "EmailAddress",
"IsRequired": True,
"MaxLength": 254
},
{
"Name": "Phone",
"FieldType": "Phone",
"MaxLength": 50
},
{
"Name": "FirstName",
"FieldType": "Text",
"MaxLength": 50
}
]
create(de_name=de_name, de_columns=de_columns, sendable_field='EmailAddress')