Fixed send email template
This commit is contained in:
parent
7c64197468
commit
35c7265bff
|
@ -1,5 +1,5 @@
|
||||||
{% if subject %}Bill {{ bill.number }}{% endif %}
|
{% if email_part == 'subject' %}Bill {{ bill.number }}{% endif %}
|
||||||
{% if message %}Dear {{ bill.account.username }},
|
{% if email_part == 'message' %}Dear {{ bill.account.username }},
|
||||||
Find your {{ bill.get_type_display.lower }} attached.
|
Find your {{ bill.get_type_display.lower }} attached.
|
||||||
|
|
||||||
If you have any question, please write us at support@orchestra.lan
|
If you have any question, please write us at support@orchestra.lan
|
||||||
|
|
|
@ -24,8 +24,10 @@ def render_email_template(template, context):
|
||||||
'scheme': url.scheme,
|
'scheme': url.scheme,
|
||||||
'domain': url.netloc,
|
'domain': url.netloc,
|
||||||
}
|
}
|
||||||
subject = render_to_string(template, {'subject': True}, context).strip()
|
context['email_part'] = 'subject'
|
||||||
message = render_to_string(template, {'message': True}, context).strip()
|
subject = render_to_string(template, context).strip()
|
||||||
|
context['email_part'] = 'message'
|
||||||
|
message = render_to_string(template, context).strip()
|
||||||
return subject, message
|
return subject, message
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue