1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from django.core.mail.message import EmailMultiAlternatives
class EmailMultiAlternativesCC(EmailMultiAlternatives):
def __init__(self, *args, **kwargs):
if kwargs.has_key('cc'):
self.cc = kwargs['cc']
del kwargs['cc']
EmailMultiAlternatives.__init__(self, *args, **kwargs)
def message(self):
msg = EmailMultiAlternatives.message(self)
if self.cc:
msg['Cc'] = ', '.join(self.cc)
return msg
def recipients(self):
l = EmailMultiAlternatives.recipients(self)
if self.cc:
return l + self.cc
return l
|
More like this
- FixedEmailMessage by buriy 5 years, 2 months ago
- Execute a signal once by johnnoone 4 years ago
- Soft Timeout Middleware by adamlofts 3 years, 11 months ago
- simple email validation function by flavio87 4 years, 7 months ago
- MultiSelectField by steph 1 year, 2 months ago
Comments