Skip to content

Commit 4998b26

Browse files
committed
fix: send dq report pdf as base64 attachment
1 parent 389d068 commit 4998b26

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

api/data_ingestion/internal/email.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,11 @@ def send_dq_report_email_with_pdf(body: EmailRenderRequest[DqReportRenderRequest
189189
"filename", f"data-quality-report-{body.props.country}.pdf"
190190
)
191191

192-
# Decode PDF and create attachment
193-
pdf_content = base64.b64decode(pdf_base64)
194-
192+
# Use base64 string directly as required by Mailjet v3 send API
195193
attachment = {
196194
"Content-type": "application/pdf",
197195
"Filename": pdf_filename,
198-
"content": pdf_content,
196+
"content": pdf_base64,
199197
}
200198

201199
# Send email with PDF attachment

0 commit comments

Comments
 (0)