Skip to content

Commit

Permalink
Merge branch 'qrcode' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Jan 21, 2025
2 parents e5a68ee + a6b9c76 commit 48f118b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ def message(self, *args, **kwargs):
)
return None

# TODO: verificare la resa nelle email del QRCode come allegato, e se non soddisfacente
# spostarlo nel testo del messaggio
# TODO: verificare la resa nelle email del QRCode come allegato,
# e se non soddisfacente spostarlo nel messaggio (che mi pare html)
# cfr:https://mailtrap.io/blog/embedding-images-in-html-email-have-the-rules-changed/
# <p><img src="cid:qrcode"></img></p>
if (
getattr(self.prenotazioni_folder, "attach_qrcode", None)
and self.prenotazione.getBookingCode()
Expand All @@ -126,7 +128,7 @@ def message(self, *args, **kwargs):
img_buffer = BytesIO()
img.save(img_buffer, format="PNG")
img_bytes = img_buffer.getvalue()
qrcodepart = MIMEImage(img_bytes)
qrcodepart = MIMEImage(img_bytes, name="qrcode")
qrcodepart.add_header(
"Content-Disposition",
f"attachment; filename={self.prenotazione.getBookingCode()}.png",
Expand Down

0 comments on commit 48f118b

Please sign in to comment.