Skip to content

Commit d46b220

Browse files
committed
Updated send_email_smtp action to support cc
1 parent 655302f commit d46b220

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

email/1.3.0/api.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ actions:
8383
required: true
8484
schema:
8585
type: string
86+
- name: cc_emails
87+
description: cc_emails
88+
multiline: false
89+
example: "[email protected]"
90+
required: false
91+
schema:
92+
type: string
8693
- name: subject
8794
description: The subject of the email
8895
multiline: false

email/1.3.0/src/app.py

Lines changed: 5 additions & 1 deletion
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, subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html"
78+
self, smtp_host, recipient, cc_emails ,subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html",
7979
):
8080
if type(smtp_port) == str:
8181
try:
@@ -112,6 +112,10 @@ def send_email_smtp(
112112
msg["From"] = username
113113
msg["To"] = recipient
114114
msg["Subject"] = subject
115+
116+
if cc_emails:
117+
msg["cc"] = cc_emails
118+
115119
msg.attach(MIMEText(body, body_type))
116120

117121
# Read the attachments

0 commit comments

Comments
 (0)