fixed batchMail?
All checks were successful
Build and Deploy Backend / build_and_deploy (push) Successful in 20s

This commit is contained in:
ebby 2026-10-02 06:00:53 +02:00
parent 30f89602f3
commit 34ed6f3144

View file

@ -1,3 +1,5 @@
from mailtrap import Address
from mailtrap import BatchMail
from pathlib import Path
from backend.config import MAILTRAP_API_TOKEN
from mailtrap import BatchEmailRequest
@ -64,13 +66,11 @@ def send_batch_mail(mails: list[BatchEmailRequest]):
else:
client = mt.MailtrapClient(token=MAILTRAP_API_TOKEN)
params = BatchSendEmailParams(
base={
"from": {
"name": "Blauwasser Mausis",
"email": "newsletter@blauwasser-mausis.de"
},
"subject": "Flaschenpost | Blauwasser Mausis",
},
base=BatchMail(
sender=Address(
email="newsletter@blauwasser-mausis.de",
name="Blauwasser Mausis"),
subject="Flaschenpost | Blauwasser Mausis"),
requests=mails
)
client.batch_send(params)