@@ -260,6 +260,7 @@ def create_template(
260260 html ,
261261 text = '' ,
262262 preheader = None ,
263+ template_data = None ,
263264 amp_html = None ,
264265 timeout = None
265266 ):
@@ -273,6 +274,8 @@ def create_template(
273274
274275 if preheader is not None :
275276 payload ['preheader' ] = preheader
277+ if template_data is not None :
278+ payload ['template_data' ] = template_data
276279 if amp_html is not None :
277280 payload ['amp_html' ] = amp_html
278281
@@ -292,6 +295,7 @@ def create_new_locale(
292295 text = '' ,
293296 html = '' ,
294297 preheader = None ,
298+ template_data = None ,
295299 amp_html = None ,
296300 timeout = None
297301 ):
@@ -308,6 +312,8 @@ def create_new_locale(
308312 payload ['text' ] = text
309313 if preheader is not None :
310314 payload ['preheader' ] = preheader
315+ if template_data is not None :
316+ payload ['template_data' ] = template_data
311317 if amp_html is not None :
312318 payload ['amp_html' ] = amp_html
313319
@@ -327,11 +333,12 @@ def create_new_version(
327333 html = None ,
328334 locale = None ,
329335 preheader = None ,
336+ template_data = None ,
330337 amp_html = None ,
331338 timeout = None
332339 ):
333340 """ API call to create a new version of a template """
334- if (html ):
341+ if (html ):
335342 payload = {
336343 'name' : name ,
337344 'subject' : subject ,
@@ -347,6 +354,8 @@ def create_new_version(
347354
348355 if preheader is not None :
349356 payload ['preheader' ] = preheader
357+ if template_data is not None :
358+ payload ['template_data' ] = template_data
350359 if amp_html is not None :
351360 payload ['amp_html' ] = amp_html
352361
@@ -374,11 +383,12 @@ def update_template_version(
374383 text = '' ,
375384 html = None ,
376385 preheader = None ,
386+ template_data = None ,
377387 amp_html = None ,
378388 timeout = None
379389 ):
380390 """ API call to update a template version """
381- if (html ):
391+ if (html ):
382392 payload = {
383393 'name' : name ,
384394 'subject' : subject ,
@@ -394,6 +404,8 @@ def update_template_version(
394404
395405 if preheader is not None :
396406 payload ['preheader' ] = preheader
407+ if template_data is not None :
408+ payload ['template_data' ] = template_data
397409 if amp_html is not None :
398410 payload ['amp_html' ] = amp_html
399411
@@ -531,24 +543,24 @@ def send(
531543 if sender :
532544 payload ['sender' ] = sender
533545 if cc :
534- if not type (cc ) == list :
546+ if not isinstance (cc , list ) :
535547 logger .error (
536548 'kwarg cc must be type(list), got %s' % type (cc ))
537549 payload ['cc' ] = cc
538550 if bcc :
539- if not type ( bcc ) == list :
551+ if not isinstance ( cc , list ) :
540552 logger .error (
541553 'kwarg bcc must be type(list), got %s' % type (bcc ))
542554 payload ['bcc' ] = bcc
543555
544556 if tags :
545- if not type ( tags ) == list :
557+ if not isinstance ( cc , list ) :
546558 logger .error (
547559 'kwarg tags must be type(list), got %s' % (type (tags )))
548560 payload ['tags' ] = tags
549561
550562 if headers :
551- if not type (headers ) == dict :
563+ if not type (headers ) is dict :
552564 logger .error (
553565 'kwarg headers must be type(dict), got %s' % (
554566 type (headers )
@@ -662,19 +674,19 @@ def start_on_drip_campaign(
662674 payload ['sender' ] = sender
663675
664676 if cc :
665- if not type (cc ) == list :
677+ if not isinstance (cc , list ) :
666678 logger .error (
667679 'kwarg cc must be type(list), got %s' % type (cc ))
668680 payload ['cc' ] = cc
669681
670682 if bcc :
671- if not type ( bcc ) == list :
683+ if not isinstance ( cc , list ) :
672684 logger .error (
673685 'kwarg bcc must be type(list), got %s' % type (bcc ))
674686 payload ['bcc' ] = bcc
675687
676688 if tags :
677- if not type ( tags ) == list :
689+ if not isinstance ( cc , list ) :
678690 logger .error (
679691 'kwarg tags must be type(list), got %s' % (type (tags )))
680692 payload ['tags' ] = tags
0 commit comments