fixed batchMail?
All checks were successful
Build and Deploy Backend / build_and_deploy (push) Successful in 20s
All checks were successful
Build and Deploy Backend / build_and_deploy (push) Successful in 20s
This commit is contained in:
parent
30f89602f3
commit
34ed6f3144
1 changed files with 7 additions and 7 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
from mailtrap import Address
|
||||||
|
from mailtrap import BatchMail
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from backend.config import MAILTRAP_API_TOKEN
|
from backend.config import MAILTRAP_API_TOKEN
|
||||||
from mailtrap import BatchEmailRequest
|
from mailtrap import BatchEmailRequest
|
||||||
|
|
@ -64,13 +66,11 @@ def send_batch_mail(mails: list[BatchEmailRequest]):
|
||||||
else:
|
else:
|
||||||
client = mt.MailtrapClient(token=MAILTRAP_API_TOKEN)
|
client = mt.MailtrapClient(token=MAILTRAP_API_TOKEN)
|
||||||
params = BatchSendEmailParams(
|
params = BatchSendEmailParams(
|
||||||
base={
|
base=BatchMail(
|
||||||
"from": {
|
sender=Address(
|
||||||
"name": "Blauwasser Mausis",
|
email="newsletter@blauwasser-mausis.de",
|
||||||
"email": "newsletter@blauwasser-mausis.de"
|
name="Blauwasser Mausis"),
|
||||||
},
|
subject="Flaschenpost | Blauwasser Mausis"),
|
||||||
"subject": "Flaschenpost | Blauwasser Mausis",
|
|
||||||
},
|
|
||||||
requests=mails
|
requests=mails
|
||||||
)
|
)
|
||||||
client.batch_send(params)
|
client.batch_send(params)
|
||||||
Loading…
Add table
Reference in a new issue