Strip newlines from email block (#1874)

This commit is contained in:
Suchintan 2025-03-04 09:26:36 -05:00 committed by GitHub
parent 0b8f64e8ab
commit 8c4dd54e33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1651,7 +1651,7 @@ class SendEmailBlock(Block):
self, workflow_run_context: WorkflowRunContext, workflow_run_id: str
) -> EmailMessage:
msg = EmailMessage()
msg["Subject"] = self.subject + f" - Workflow Run ID: {workflow_run_id}"
msg["Subject"] = self.subject.strip().replace('\n', '').replace('\r', '') + f" - Workflow Run ID: {workflow_run_id}"
msg["To"] = ", ".join(self.get_real_email_recipients(workflow_run_context))
msg["BCC"] = self.sender # BCC the sender so there is a record of the email being sent
msg["From"] = self.sender