Skip to content

Commit 7e50e45

Browse files
committed
Add check for empty body or template
1 parent 9a7ceeb commit 7e50e45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pysendpulse/pysendpulse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def smtp_send_mail(self, email):
671671
@return: dictionary with response message
672672
"""
673673
logging.info("Function call: smtp_send_mail")
674-
if not email.get('html') or not email.get('text'):
674+
if (not email.get('html') or not email.get('text')) and not email.get('template'):
675675
return self.__handle_error('Seems we have empty body')
676676
elif not email.get('subject'):
677677
return self.__handle_error('Seems we have empty subject')
@@ -686,7 +686,7 @@ def smtp_send_mail_with_template(self, email):
686686
@param email: string valid email address. We will send an email message to the specified email address with a verification link.
687687
@return: dictionary with response message
688688
"""
689-
logging.info("Function call: smtp_send_mail_template")
689+
logging.info("Function call: smtp_send_mail_with_template")
690690
if not email.get('template'):
691691
return self.__handle_error('Seems we have empty template')
692692
elif not email.get('template').get('id'):

0 commit comments

Comments
 (0)