Page 1 of 1

Attachments and 2.5

Posted: Wed Jul 03, 2013 11:37 am
by TimPSNC
Script URL:
Version of script: 2.5.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

I've started using 2.5.0 and all looks good, however, when an attachment is removed the notification of this isn't very pretty- it gets buried in the message of the email. Is it possible to to have this under the attachments section/heading, so it is more easily seen?

Also, I'm pleased to see that there is a link to download the attachment. Is there a way of inserting this link directly into the message sent (ie a staff member can write click the following link to download, and then have press a button to have it inserted there)? Currently it is at the bottom of the email which gets lost, as it is now under my signature and disclaimer.

Re: Attachments and 2.5

Posted: Wed Jul 03, 2013 5:40 pm
by Klemen
You can try adding it just below message by changing this code in inc/email_functions.inc.php

Code: Select all

		// Replace message
		$msg = str_replace('%%MESSAGE%%',$ticket['message'],$msg);

		// Add direct links to any attachments at the bottom of the email message
		if ($hesk_settings['attachments']['use'] && isset($ticket['attachments']) && strlen($ticket['attachments']) )
		{
			$msg .= "\n\n\n" . $hesklang['fatt'];

			$att = explode(',', substr($ticket['attachments'], 0, -1));
			foreach ($att as $myatt)
			{
				list($att_id, $att_name) = explode('#', $myatt);
				$msg .= "\n\n" . $att_name . "\n" . $hesk_settings['hesk_url'] . '/download_attachment.php?att_id='.$att_id.'&track='.$ticket['trackid'].$hesk_settings['e_param'];
			}
		}
to

Code: Select all

		// Add direct links to any attachments at the bottom of the email message
        $tmp = '';
		if ($hesk_settings['attachments']['use'] && isset($ticket['attachments']) && strlen($ticket['attachments']) )
		{
			$tmp .= "\n\n\n" . $hesklang['fatt'];

			$att = explode(',', substr($ticket['attachments'], 0, -1));
			foreach ($att as $myatt)
			{
				list($att_id, $att_name) = explode('#', $myatt);
				$tmp .= "\n\n" . $att_name . "\n" . $hesk_settings['hesk_url'] . '/download_attachment.php?att_id='.$att_id.'&track='.$ticket['trackid'].$hesk_settings['e_param'];
			}
		}

		// Replace message
		$msg = str_replace('%%MESSAGE%%',$ticket['message'] . $tmp,$msg);

Direct links inserted within text are not supported I'm afraid.