Skip to content

Instantly share code, notes, and snippets.

@yumike
Created July 26, 2011 06:38
Show Gist options
  • Save yumike/1106130 to your computer and use it in GitHub Desktop.
Save yumike/1106130 to your computer and use it in GitHub Desktop.
Mailer.send(
sender = '[email protected]',
recipients = ['[email protected]', '[email protected]'],
context_data = {'site': site},
template_name = 'mailer/messages/message')
ModelMailer.send(
object = message,
request = request,
recipients = Recipient.objects.values_list('email', flat=True))
class MessageMailer(ModelMailer):
recipients = Recipient.objects.values_list('email', flat=True)
fail_silently = True
class MessageSenderMailer(ModelMailer):
def get_recipients(self):
return self.get_object().email
MessageMailer.send(object=message, request=request)
MessageSenderMailer.send(object=message, request=request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment