I'm puzzled why I can't get the contact-us form not working anymore. My email system is working fine with test messages and also messages are send correctly during the order process. But when anybody submits the contact-us form, there is an error message displayed after some 10 seconds or so (and the submitted info is stored in the backoffice). I'm using TB 1.08 and I have migrated from PS 1.6.18 (half a year ago or so).
I already looked at the code in the ContactController.php and was able to figure out that it is the error message that is generated in this function:
if (empty($contact->email)) {
Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $varList, $from, null, null, null, $fileAttachment);
} else {
if (!Mail::Send(
$this->context->language->id,
'contact',
Mail::l('Message from contact form').' [no_sync]',
$varList,
$contact->email,
$contact->name,
null,
null,
$fileAttachment,
null,
_PS_MAIL_DIR_,
false,
null,
null,
$from
) || !Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $varList, $from, null, null, null, $fileAttachment, null, _PS_MAIL_DIR_, false, null, null, $contact->email)
) {
$this->errors[] = Tools::displayError('An error occurred while sending the message 3.');
}
but I don't understand why this can happen. I also don not understand why I can't find only one .tpl file (contact-form.tpl, I would expect also a contact.tpl file). And what does this code do? Is it trying to send two mails (I'm not an php expert)?
I'm afraid that I'm missing something. Any help is apprectiated a lot!
Edit: I already figured out that there are indeed two templates for the emails. I'm afraid I have to debug the Mail::Send function to find the cause of this issue. But I'm still not sure what the code above is doing exactly..
Question
Dolfijn
Hello,
I'm puzzled why I can't get the contact-us form not working anymore. My email system is working fine with test messages and also messages are send correctly during the order process. But when anybody submits the contact-us form, there is an error message displayed after some 10 seconds or so (and the submitted info is stored in the backoffice). I'm using TB 1.08 and I have migrated from PS 1.6.18 (half a year ago or so).
I already looked at the code in the ContactController.php and was able to figure out that it is the error message that is generated in this function:
if (empty($contact->email)) { Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $varList, $from, null, null, null, $fileAttachment); } else { if (!Mail::Send( $this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', $varList, $contact->email, $contact->name, null, null, $fileAttachment, null, _PS_MAIL_DIR_, false, null, null, $from ) || !Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $varList, $from, null, null, null, $fileAttachment, null, _PS_MAIL_DIR_, false, null, null, $contact->email) ) { $this->errors[] = Tools::displayError('An error occurred while sending the message 3.'); }
but I don't understand why this can happen. I also don not understand why I can't find only one .tpl file (contact-form.tpl, I would expect also a contact.tpl file). And what does this code do? Is it trying to send two mails (I'm not an php expert)?
I'm afraid that I'm missing something. Any help is apprectiated a lot!
Edit: I already figured out that there are indeed two templates for the emails. I'm afraid I have to debug the Mail::Send function to find the cause of this issue. But I'm still not sure what the code above is doing exactly..
12 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now