Replies: 2 comments
-
Resolved by adding |
Beta Was this translation helpful? Give feedback.
-
You can use from django.conf import settings
from django.core.mail import get_connection, EmailMessage
connection1 = get_connection(settings.EMAIL_BACKEND, api_key="api-key-1")
send_mail("Sent using api-key-1", ..., connection=connection1)
connection2 = get_connection(settings.EMAIL_BACKEND, api_key="api-key-2")
send_mail("Sent using api-key-2", ..., connection=connection2)
message = EmailMessage("Also sent using api-key-2", ..., connection=connection2)
message.send() You can override almost all Anymail backend settings this way. So you could use In Anymail's docs, see Anymail settings reference for more info on settings overrides, and Mixing email backends for some specific |
Beta Was this translation helpful? Give feedback.
-
Hi, it would be nice to set API key of email backend manually during runtime (from Admin), not just in settings. I have a project that needs to set multiple EmailBackends with multiple api keys. Would it be possible to add a
setter
likeset_api_key
to EmailBackend?Beta Was this translation helpful? Give feedback.
All reactions