Subject line will omit RT formatting if no number is provided.
This commit is contained in:
parent
4dee825973
commit
4c5c3fed63
1 changed files with 17 additions and 7 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue