diff --git a/inc/email_functions.inc.php b/inc/email_functions.inc.php index 0ebc0735..a347a0a1 100644 --- a/inc/email_functions.inc.php +++ b/inc/email_functions.inc.php @@ -56,8 +56,8 @@ function hesk_notifyCustomerForVerifyEmail($email_template = 'verify_email', $ac } // Format email subject and message - $subject = hesk_getEmailSubject($email_template); - $message = hesk_getEmailMessage($email_template, null, 0, 0, 0); + $subject = hesk_getEmailSubject($email_template, $ticket); + $message = hesk_getEmailMessage($email_template, $ticket); $activationUrl = $hesk_settings['hesk_url'] . '/verifyemail.php?key=%%ACTIVATIONKEY%%'; $message = str_replace('%%VERIFYURL%%', $activationUrl, $message); $message = str_replace('%%ACTIVATIONKEY%%', $activationKey, $message); @@ -244,6 +244,9 @@ function hesk_validEmails() // --> Ticket closed 'ticket_closed' => $hesklang['ticket_closed'], + // --> Verify email + 'verify_email' => $hesklang['verify_email'], + /*** Emails sent to STAFF ***/ diff --git a/submit_ticket.php b/submit_ticket.php index 64cce680..5b279d83 100644 --- a/submit_ticket.php +++ b/submit_ticket.php @@ -374,15 +374,14 @@ if ($modsForHesk_settings['customer_email_verification_required']) //-- generate the activation key, which is a hash of their email address along with the current time. $unhashedKey = $tmpvar['email'].time(); - $key = hash('sha512', $unhashed); + $key = hash('sha512', $unhashedKey); $escapedEmail = hesk_dbEscape($tmpvar['email']); $escapedKey = hesk_dbEscape($key); hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."pending_verification_emails` (`Email`, `ActivationKey`) VALUES ('".$escapedEmail."', '".$escapedKey."')"); - require(HESK_PATH . 'inc/email_functions.inc.php'); - hesk_notifyCustomer('verify_email'); + hesk_notifyCustomerForVerifyEmail('verify_email', $key); $createTicket = false; } } diff --git a/verifyemail.php b/verifyemail.php index 01e2164b..a77999e7 100644 --- a/verifyemail.php +++ b/verifyemail.php @@ -8,6 +8,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); hesk_load_database_functions(); require(HESK_PATH . 'inc/posting_functions.inc.php'); +require(HESK_PATH . 'inc/email_functions.inc.php'); require_once(HESK_PATH . 'inc/header.inc.php'); ?>