Originally Posted by
clsmky
Ok sorry If I missed it, but I read this entire thread and couldnt find my answer.
Has anyone figured out how to send a confirmation email to the customer after the "you message has been sent" success page?
I have no complaints other than now I want to have a confirmation email sent. I'm using this for a physical catalog request (
you can see it here) and I've got it to work perfectly. I get all the correct info and everything lands where its supposed to when its sent. It even checks if the patron is logged into the site to fill in some of the fields. Once the form is submitted, it goes to a
page that states that the request has been sent. I would like it to send a confirmation email to the customer thanking them for their interest in the company and so on.
How do I do that? Just need to be pointed in the right direction is all.
I guess I should contribute to this thread since Dr. Byte was able to help me out so quickly.
------------------------------------------------------------------------------------------------------------
under the header.php file for my form I added the following under the line that says
PHP Code:
$email_html = nl2br($email_text);
This is my custom code:
PHP Code:
//assemble customer email contents:
$customer_email_text =
CUSTOMER_EMAIL_GREETING . '' . $full_name . ',' . "\n" .
"\n" .
CUSTOMER_EMAIL_BODY_TEXT . "\n" .
"\n" .
CUSTOMER_EMAIL_BODY_QUESTIONS . "\n" .
"\n" .
CUSTOMER_EMAIL_BODY_THANKS . "\n\n" .
$customer_email_text = zen_output_string_protected($customer_email_text);
$customer_email_html = nl2br("\n" . $customer_email_text);
then after the line that starts with "zen_mail(STORE_NAME...." I added the following:
PHP Code:
//send email to customer
zen_mail($full_name, $email_address, CUSTOMER_EMAIL_SUBJECT, $customer_email_text, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => $customer_email_html), 'catalog_req');
to my languages file I added:
PHP Code:
define('CUSTOMER_EMAIL_GREETING','Hello ');
define('CUSTOMER_EMAIL_SUBJECT', 'Your Catalog is on its way!');
define('CUSTOMER_EMAIL_BODY_TEXT', 'Thank you for your interest in our company and its products. We will mail out a copy of our 2011 catalog for you today and you should be receiving it in a matter of a few days. ');
define('CUSTOMER_EMAIL_BODY_QUESTIONS', 'If you have any questions regarding our company or any of the products you see in the catalog or online, please feel free to contact us through this email address or call us toll free at <removed phone number> .');
define('CUSTOMER_EMAIL_BODY_THANKS', 'Thanks again and have a great day!');
For the html email template (catalog_req) I simply made an html file that consists of a table containing our logo, information (just like a letterhead) and the $EMAIL_MESSAGE_HTML so that it would populate what is defined in the language files.
If you want to create or take a look at my files, I can send them to you through email. I dont want to post them here because I originally worked off of a TM file (per my boss) that I completely hacked and virtually started from scratch. So most of the code is for my custom template but I don't mind sharing with those that want it anyway.
Bookmarks