Skip to content

Commit 1f575f7

Browse files
authored
fix: Sending email notification with empty CC/Bcc (#473)
Signed-off-by: Armin Leuprecht <[email protected]>
1 parent 5e35880 commit 1f575f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

notifiers/providers/email.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ def _prepare_data(self, data: dict) -> dict:
138138
def _build_email(data: dict) -> EmailMessage:
139139
email = EmailMessage()
140140
email["To"] = data["to"]
141-
email["CC"] = data.get("cc", [])
142-
email["Bcc"] = data.get("bcc", [])
141+
if "cc" in data:
142+
email["CC"] = data.get("cc")
143+
if "bcc" in data:
144+
email["Bcc"] = data.get("bcc")
143145
email["From"] = data["from"]
144146
email["Subject"] = data["subject"]
145147
email["Date"] = formatdate(localtime=True)

0 commit comments

Comments
 (0)