#30 Add email function for verify email

merge-requests/2/head
Mike Koch 9 years ago
parent 418338c509
commit 81fb037335

@ -46,6 +46,25 @@ if ($hesk_settings['smtp'])
}
}
function hesk_notifyCustomerForVerifyEmail($email_template = 'verify_email', $activationKey)
{
global $hesk_settings, $ticket;
if (defined('HESK_DEMO'))
{
return true;
}
// Format email subject and message
$subject = hesk_getEmailSubject($email_template);
$message = hesk_getEmailMessage($email_template, null, 0, 0, 0);
$activationUrl = $hesk_settings['hesk_url'] . '/verifyemail.php?key=%%ACTIVATIONKEY%%';
$message = str_replace('%%VERIFYURL%%', $activationUrl, $message);
$message = str_replace('%%ACTIVATIONKEY%%', $activationKey, $message);
hesk_mail($ticket['email'], $subject, $message);
}
function hesk_notifyCustomer($email_template = 'new_ticket')
{

@ -0,0 +1,10 @@
Dear %%NAME%%,
Your email needs to be verified before your ticket can be submitted. Please click the link below to verify your email.
%%VERIFYURL%%
Sincerely,
%%SITE_TITLE%%
%%SITE_URL%%

@ -377,8 +377,8 @@ if ($verifiedEmailRS->num_rows == 0)
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."pending_verification_emails` (`Email`, `ActivationKey`)
VALUES ('".$escapedEmail."', '".$escapedKey."')");
/* TODO Send email to customer asking to verify email address. A link with the activation key will be in the email
for them to visit to activate. */
require(HESK_PATH . 'inc/email_functions.inc.php');
hesk_notifyCustomer('verify_email');
} else
{
//-- email has been verified, and a ticket can be created

Loading…
Cancel
Save