Browse Source

#330 Add MESSAGE_NO_ATTACHMENTS tag

merge-requests/2/head
Mike Koch 6 years ago
parent
commit
77489d8eef
  1. 1
      admin/manage_email_templates.php
  2. 11
      inc/email_functions.inc.php
  3. 3
      language/en/text.php

1
admin/manage_email_templates.php

@ -289,6 +289,7 @@ function getSpecialTagMap() {
$map['%%EMAIL%%'] = $hesklang['customer_email'];
$map['%%SUBJECT%%'] = $hesklang['ticket_subject'];
$map['%%MESSAGE%%'] = $hesklang['ticket_message'];
$map['%%MESSAGE_NO_ATTACHMENTS%%'] = $hesklang['ticket_message_no_attachments'];
$map['%%CREATED%%'] = $hesklang['ticket_created'];
$map['%%UPDATED%%'] = $hesklang['ticket_updated'];
$map['%%TRACK_ID%%'] = $hesklang['ticket_trackID'];

11
inc/email_functions.inc.php

@ -738,8 +738,10 @@ function hesk_processMessage($msg, $ticket, $is_admin, $is_ticket, $just_message
if ($isForHtml)
{
$htmlMessage = nl2br($ticket['message']);
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%', $htmlMessage, $msg);
return str_replace('%%MESSAGE%%', $htmlMessage, $msg);
}
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%', $ticket['message'], $msg);
return str_replace('%%MESSAGE%%', $ticket['message'], $msg);
}
else
@ -863,6 +865,15 @@ function hesk_processMessage($msg, $ticket, $is_admin, $is_ticket, $just_message
{
$msg = $hesklang['EMAIL_HR'] . "\n\n" . $msg;
}
} elseif (strpos($msg, '%%MESSAGE_NO_ATTACHMENTS%%') !== false) {
if ($isForHtml)
{
$htmlMessage = nl2br($ticket['message']);
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%', $htmlMessage, $msg);
} else
{
$msg = str_replace('%%MESSAGE_NO_ATTACHMENTS%%',$ticket['message'],$msg);
}
}
return $msg;

3
language/en/text.php

@ -21,6 +21,9 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// This is the email break line that will be used in email piping
$hesklang['EMAIL_HR']='------ Reply above this line ------';
// ADDED OR MODIFIED IN Mods for HESK 2.5.0
$hesklang['ticket_message_no_attachments'] = 'Ticket/Reply message, however attachments will not be included in the email';
// ADDED OR MODIFIED IN Mods for HESK 2.4.0
$hesklang['sort_by_user_defined_order'] = 'Sort by user-defined order';
$hesklang['sort_alphabetically'] = 'Sort alphabetically';

Loading…
Cancel
Save