Skip to content

Commit 9a75d95

Browse files
committed
made cc_emails field optional in Python
1 parent b03e318 commit 9a75d95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

email/1.3.0/src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def send_email_shuffle(self, apikey, recipients, subject, body):
7575
return requests.post(url, headers=headers, json=data).text
7676

7777
def send_email_smtp(
78-
self, smtp_host, recipient, cc_emails ,subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html",
78+
self, smtp_host, recipient, subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html", cc_emails=""
7979
):
8080
if type(smtp_port) == str:
8181
try:
@@ -113,7 +113,7 @@ def send_email_smtp(
113113
msg["To"] = recipient
114114
msg["Subject"] = subject
115115

116-
if cc_emails:
116+
if cc_emails != None and len(cc_emails) > 0:
117117
msg["Cc"] = cc_emails
118118

119119
msg.attach(MIMEText(body, body_type))

0 commit comments

Comments
 (0)