AgustinCecotec Posted November 21, 2016 Share Posted November 21, 2016 I want to know if it's possible to change the $from variable to receive the mails from the contact form directly from the customer mail and not from our website mail, because it's a nuissance to have in our e-mail all the emails coming from the same email address due to how they appear (in vertical alignment, one below another), and it's horrible to manage what mails have been responded or not. I'm trying to do this, and I think the "magic" could be done somewhere between this lines inside the "ContactController.php" 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')), $var_list, $from, null, null, null, $file_attachment); } else { if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', $var_list, $contact->email, $contact->name, null, null, $file_attachment, 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')), $var_list, $from, null, null, null, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $contact->email)) { $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } } I tried to change the $contact->email for the $from variable(because it appears to have stored the customer email from the form), but this way the mails are not sending, although the succes message is appering. Thanks to someone who can help. Greetings, Agustin. Link to comment Share on other sites More sharing options...
AgustinCecotec Posted December 5, 2016 Author Share Posted December 5, 2016 (edited) Nobody? Edited December 5, 2016 by AgustinCecotec (see edit history) Link to comment Share on other sites More sharing options...
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