Page 1 of 1
[SOLVED] Add the customer email in the landing page after new ticket creation
Posted: Mon Dec 30, 2024 9:52 am
by corsari
Script URL:
Version of script: 3.5.1
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:
Hello
when a visitor creates a new ticket, right after having clicked the "Submit Ticket" button , he/she lands on a landing page that states "Your ticket is sent" and also it shows the ticket ID
also there is a message written in RED telling about the emails that goes in the SPAM folder
Here I want to write/use the email address that the customer entered in the form
Is there a variable for that purpose to be used in that landing page? This is fundamental for the user to check if he wrote correctly his/her mail address
Thank you
Re: Add the customer email in the landing page after new ticket creation
Posted: Wed Jan 01, 2025 3:02 pm
by Klemen
There is no email variable passed directly.
You would either need to pass it to the template in /submit_ticket.php, or define global $ticket; in the theme file and use $ticket['email'] there.
Note that such customizations are out of the scope of support we provide here, so please consult a PHP developer if you cannot get it to work yourself.
Re: Add the customer email in the landing page after new ticket creation
Posted: Wed Jan 01, 2025 4:08 pm
by corsari
Thank you
For the reply and for the hint
[SOLUTION] Add the customer email in the landing page after new ticket creation
Posted: Wed Jan 01, 2025 6:29 pm
by corsari
Hello
Allow me to kindly suggest this modification/implementation to HESK when the ticket is correctly created.
In fact, it happens that the user, absentmindedly or distracted, enters an email they no longer use or forgets that their email address included a number or digit in addition to their first and last name, or as well absentmindedly or distracted types twice the same typo
the following modifications will add a graceful and magnified (H2) phrase stating
Mail sent to: mail-address-typed-by@the.user
right below is fired the message $hesklang['spam_inbox'] found again in the text.php which should be modified accordingly, e.g. in my case
"
No confirmation message? Double-check the email address above.
We have sent a confirmation message to that email address. If it is entered correctly but you do not receive anything within a few minutes, please check your "Spam," "Junk," or "Unwanted" mail folders.
To manage this case, you will need to receive notifications from this system, so we recommend marking the message as NOT SPAM if necessary.
If you have mistyped some character, please create a new ticket."
Applied changes:
added a string in the file text.php in /languages. Added
Code: Select all
$hesklang['email_check_conf']='<span><h2>Mail sent to: ';
as suggested, added a variable to ./submit_ticket.php around line 660
Code: Select all
$hesk_settings['render_template'](TEMPLATE_PATH . 'customer/create-ticket/create-ticket-confirmation.php', array(
'trackingId' => $ticket['trackid'],
'emailProvided' => $email_available,
'messages' => $messages,
'serviceMessages' => hesk_get_service_messages('t-ok'),
'customerLoggedIn' => $user_context !== null,
'customerUserContext' => $user_context,
'userEmailInput' => $_POST['email']
));
and finally updated the template view customer/create-ticket/create-ticket-confirmation.php around line 102
Code: Select all
if ($emailProvided && $hesk_settings['notify_new'] && $hesk_settings['spam_notice']) {
echo $hesklang['email_check_conf'].$userEmailInput.'</h2></span>';
echo $hesklang['spam_inbox'];
}
Re: [SOLVED] Add the customer email in the landing page after new ticket creation
Posted: Wed Jan 01, 2025 6:50 pm
by Klemen
Thanks for sharing your solution!