Changed BaseEmail to accept from_address to modify the from header accordingly
This commit is contained in:
parent
a44f64e8e7
commit
a60ef7cf7a
2 changed files with 10 additions and 1 deletions
|
@ -133,6 +133,7 @@ class OrderView(TemplateView):
|
||||||
}
|
}
|
||||||
email_data = {
|
email_data = {
|
||||||
'subject': 'New Order Received',
|
'subject': 'New Order Received',
|
||||||
|
'from_address': '(datacenterlight) datacenterlight Support <support@datacenterlight.ch>',
|
||||||
'to': 'info@ungleich.ch',
|
'to': 'info@ungleich.ch',
|
||||||
'context': context,
|
'context': context,
|
||||||
'template_name': 'new_order_notification',
|
'template_name': 'new_order_notification',
|
||||||
|
@ -157,6 +158,7 @@ class BetaAccessView(FormView):
|
||||||
|
|
||||||
email_data = {
|
email_data = {
|
||||||
'subject': 'DatacenterLight Beta Access Request',
|
'subject': 'DatacenterLight Beta Access Request',
|
||||||
|
'from_address': '(datacenterlight) datacenterlight Support <support@datacenterlight.ch>',
|
||||||
'to': form.cleaned_data.get('email'),
|
'to': form.cleaned_data.get('email'),
|
||||||
'context': context,
|
'context': context,
|
||||||
'template_name': 'request_access_confirmation',
|
'template_name': 'request_access_confirmation',
|
||||||
|
@ -171,6 +173,7 @@ class BetaAccessView(FormView):
|
||||||
|
|
||||||
email_data = {
|
email_data = {
|
||||||
'subject': 'DatacenterLight Beta Access Request',
|
'subject': 'DatacenterLight Beta Access Request',
|
||||||
|
'from_address': '(datacenterlight) datacenterlight Support <support@datacenterlight.ch>',
|
||||||
'to': 'info@ungleich.ch',
|
'to': 'info@ungleich.ch',
|
||||||
'context': context,
|
'context': context,
|
||||||
'template_name': 'request_access_notification',
|
'template_name': 'request_access_notification',
|
||||||
|
@ -221,6 +224,7 @@ class BetaProgramView(CreateView):
|
||||||
|
|
||||||
email_data = {
|
email_data = {
|
||||||
'subject': 'DatacenterLight Beta Access Request',
|
'subject': 'DatacenterLight Beta Access Request',
|
||||||
|
'from_address': '(datacenterlight) datacenterlight Support <support@datacenterlight.ch>',
|
||||||
'to': 'info@ungleich.ch',
|
'to': 'info@ungleich.ch',
|
||||||
'context': context,
|
'context': context,
|
||||||
'template_name': 'request_beta_access_notification',
|
'template_name': 'request_beta_access_notification',
|
||||||
|
@ -260,6 +264,7 @@ class IndexView(CreateView):
|
||||||
|
|
||||||
email_data = {
|
email_data = {
|
||||||
'subject': 'DatacenterLight Beta Access Request',
|
'subject': 'DatacenterLight Beta Access Request',
|
||||||
|
'from_address': '(datacenterlight) datacenterlight Support <support@datacenterlight.ch>',
|
||||||
'to': form.cleaned_data.get('email'),
|
'to': form.cleaned_data.get('email'),
|
||||||
'context': context,
|
'context': context,
|
||||||
'template_name': 'request_access_confirmation',
|
'template_name': 'request_access_confirmation',
|
||||||
|
@ -274,6 +279,7 @@ class IndexView(CreateView):
|
||||||
|
|
||||||
email_data = {
|
email_data = {
|
||||||
'subject': 'DatacenterLight Beta Access Request',
|
'subject': 'DatacenterLight Beta Access Request',
|
||||||
|
'from_address': '(datacenterlight) datacenterlight Support <support@datacenterlight.ch>',
|
||||||
'to': 'info@ungleich.ch',
|
'to': 'info@ungleich.ch',
|
||||||
'context': context,
|
'context': context,
|
||||||
'template_name': 'request_access_notification',
|
'template_name': 'request_access_notification',
|
||||||
|
|
|
@ -21,6 +21,9 @@ class BaseEmail(object):
|
||||||
|
|
||||||
self.email = EmailMultiAlternatives(self.subject, text_content)
|
self.email = EmailMultiAlternatives(self.subject, text_content)
|
||||||
self.email.attach_alternative(html_content, "text/html")
|
self.email.attach_alternative(html_content, "text/html")
|
||||||
|
if 'from_address' in kwargs:
|
||||||
|
self.email.from_email = kwargs.get('from_address')
|
||||||
|
else:
|
||||||
self.email.from_email = '(ungleich) ungleich Support <info@ungleich.ch>'
|
self.email.from_email = '(ungleich) ungleich Support <info@ungleich.ch>'
|
||||||
self.email.to = [kwargs.get('to', 'info@ungleich.com')]
|
self.email.to = [kwargs.get('to', 'info@ungleich.com')]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue