Jump to content

Send Custom Email Not Sending But No Error


Recommended Posts

Hello, I want to create a payment confirmation page where user input some information in the fields provided and when user press Send it will send an email containing the informations to admin email. I have created the page and controller and email template and everything needed based on contact form (Contact Us) with some modifications.
 

I am using prestashop send mail function:

Mail::Send($this->context->language->id, 'paymentconfirmation_admin', Mail::l('Payment Confirmation From Customer').' [no_sync]',
						$var_list, $contact_email, null, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''),
								$fileAttachment);

paymentconfirmation_admin is the mail template and I have created them

 

I don't really know how to assign the variables into the template, they are stored in the var_list, right? I tried to make the var_list like this (modified it from contactcontroller.php code):

$var_list = array(
									'{order_name}' => '-',
									'{attached_file}' => '-',
									'{id_name}' => '-',
									'{bankAccount}' => '-',
									'{bankDest}' => '-',
									'{trfDate}' => '-',
									'{amount}' => '-',
									'{message}' => '-',
									'{email}' =>  $from,
								);

{order_name} and the others, where are they got from? Are they from the field name from the .tpl? How does this variables array work?

 

I assigned the value of contact_email manually before with:

$contact_email = '[email protected]'

 

The problem is, when I tested the Send button, it returned no error. But no email was sent to my inbox. The page was displaying the success screen like when you successfully sent a message to customer service on Contact Us page.

 

Any help would be appreciated.

Edited by frii (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...