Subject line will omit RT formatting if no number is provided.

This commit is contained in:
kououken 2019-03-01 13:11:41 -08:00
parent 4dee825973
commit 4c5c3fed63

View file

@ -391,6 +391,16 @@ def send_report_to_admin(request, report_pk):
cc = request.user.email
msg_html = render_to_string('backend/email.html', params)
msg_plain = render_to_string('backend/email.txt', params)
message = None
if params['reference_number'] == '':
message = EmailMultiAlternatives(
"{}".format(params['title']),
msg_plain,
from_email,
[to_email],
cc=[request.user.email],
)
else:
message = EmailMultiAlternatives(
"[RT - Request Tracker #{}] {}".format(params['reference_number'], params['title']),
msg_plain,