0

I'm sending email in Django:

...
recipient_list = ['first@recipient.com', 'second@recipient.com',]

mail = EmailMessage('Subject', 'content body', [sender@email.com], recipient_list)
mail.send()

In the template I'm rendering I would like to extract single recipient like this.

template.html

...
This message was sent at {{ datetime_sent }} to address {{ recipient_address }}. 

I don't want to pass recipient_list in every email in case of mass email, but rather a single recipient address. Is this possible?

Sunderam Dubey
  • 1
  • 11
  • 20
  • 40

1 Answers1

0

You won't be able to customise this sort of information sending the same email to more than one recipient. What you will want is to use Django's mass mail function, see here:

https://docs.djangoproject.com/en/4.0/topics/email/#send-mass-mail

You can access the recipient as {{ mail.to }} in your template

0sVoid
  • 2,547
  • 1
  • 10
  • 25