Hi max, firstly thanks for your previous message.
I've been working on integrating the email verification part of the diff manually with 3.3b1. The integration seems to be fine but i think some of the calls that worked in 3.1 no longer work.
e.g. this line is broken
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
{
$this->outputAsJson(array('success' => false));
return false;
}
results in the following no matter what is entered into the email field.
"E-mail address invalid"
but if the line is removed.
"Verification e-mail sent. Please check your e-mail."
however the email itself doesn't actually send.
i'm pretty sure the problem lies somewhere in the lines under added to order/controllers/main.php
/**
* AJAX method that sends verification e-mail to customer
*/
public function sendVerificationEmail()
{
if (!$this->isAjax())
$this->redirect($this->base_uri . "plugin/order/");
$email = $_POST['email'];
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
{
$this->outputAsJson(array('success' => false));
return false;
}
if ($email != $this->Session->read('verification_email'))
{
$code = dechex(mt_rand());
$this->Session->write('verification_email', $email);
$this->Session->write('verification_code', $code);
}
else
{
$code = $this->Session->read('verification_code');
}
Loader::loadModels($this, array("Emails"));
$template_name = "account_email_verification";
$tags = array(
'contact' => $_POST,
'company' => $this->Companies->get($this->company_id),
'code' => $code
);
$this->Emails->send($template_name, $this->company_id, null, $email, $tags);
$this->outputAsJson(array('success' => true));
return false;
}
any idea what may need to be updated firstly for the validation filter not to result in errors and secondly for the email to actually send?
thanks.