Page 1 of 1
PHP file containing email notice to staff
Posted: Sat Aug 21, 2021 3:12 pm
by ArcherData
Script URL:
https://archerdata.com/helpdesk
Version of script: 3.2.3
Hosting company: Archer Data Hosting
URL of phpinfo.php:
https://archerdata.com/serverprofile.php
URL of session_test.php:
What terms did you try when SEARCHING for a solution: email staff notice
Write your message below:
I am having difficulty locating the code file and block where emails are sent to staff when a new ticket is created.
Don
Re: PHP file containing email notice to staff
Posted: Sat Aug 21, 2021 3:22 pm
by Klemen
Would help to know what you are trying to achieve.
If you only want to edit the messages, go to Admin > Tools > Email templates
If you want to change the email logic, it's mostly in inc/email_functions.inc.php
If a ticket is submitted using the web form, the mailing functions (hesk_notifyAssignedStaff, hesk_notifyStaff) are called from submit_ticket.php
Re: PHP file containing email notice to staff
Posted: Sat Aug 21, 2021 11:52 pm
by ArcherData
I apologize for being a bit vague.
The support staff work remotely, so they don't always have HESK open.
What I want to have happen:
• When a new ticket is created, let HESK send emails to the submitter and to the staff as normal.
• I want to inject the PHP code to send a one-way SMS text message to the support staff to alert them there's a new ticket.
• This message is a canned and contains no details — just a "heads up" that a ticket came in.
• In my case, I don't even need a response via text message.
So, I need to know where to insert the block of PHP code that sends the SMS via the TextMagic service.
It would be great if there was a place that works like header.txt/footer.txt does to cleanly insert additional code at the appropriate spot.
I hope this helps.
Don
Re: PHP file containing email notice to staff
Posted: Sun Aug 22, 2021 12:02 am
by ArcherData
On inspection of submit_ticket.php at the break at line 525 — this would (on the surface) seem like a place where the SMS text message code that connects to TextMagic and sends the alert might possibly go. Here's the PHP block:
Code: Select all
$client = new TextmagicRestClient('USERNAME', 'KEY');
$result = ' ';
try {
$result = $client->messages->create(
array(
'text' => 'CANNED ALERT MESSAGE',
'phones' => implode(', ', array('+12345678901'))
)
);
}
catch (\Exception $e) {
if ($e instanceof RestException) {
print '[ERROR] ' . $e->getMessage() . "\n";
foreach ($e->getErrors() as $key => $value) {
print '[' . $key . '] ' . implode(',', $value) . "\n";
}
} else {
print '[ERROR] ' . $e->getMessage() . "\n";
}
return;
}
echo $result['id'];
My only concern is that something may interfere with HESK's logic and functions.
Don
Re: PHP file containing email notice to staff
Posted: Sun Aug 22, 2021 7:18 am
by Klemen
It will most likely go to the submit_ticket.php file.
To not interfere with Hesk, you will most likely need to get rid of the print and echo statements. Might be a good idea to ask a PHP developer for help to get you integrated properly.
Re: PHP file containing email notice to staff
Posted: Sun Aug 22, 2021 3:48 pm
by ArcherData
Thank you very much for your guidance.
Don