Zen Follower
- Join Date:
- Jan 2009
- Location:
- The Netherlands/Germany
- Posts:
- 144
- Plugin Contributions:
- 4
customer email adress from checkout_succes page...
Dear community & devś,
At the moment iḿ trying to trigger a feedback email from the checkout succes page.
This is for a customer review site...
The idea is following:
After customers checkout successfully a link is triggered which will send the customer an email to please review the webshop.
So after reading and thinking about is my thought was to let the link behave in the tracking pixel fashion way.
So i put following code into the includes/templates/MYTEMPLATE/checkout_success/tpl_footer.php
<?php
$capture = file_get_contents('https://DOMAIN.TLD/set.php?user=USERNAME&connector=SHA1STRING&action=sendInvitation&targetMail=EMAILADRESS&delay=DAYS');
?>
When i hard code all the information then there is no problem... email adress is send and the invitation email to review the webshop has been received.
To hardcode the user, sha1string & delay is not a problem at first... (can always write a admin to it further on). My problem is to get the customers email adress.
I tried to get it from the header_php.php by adding:
$customer_email_query = "SELECT customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = ':customersID' ";
$customer_email = $db->Execute($customer_email_query);
or this:
$customer_email_query = "SELECT customers_email_address
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = ':customersID' ";
$customer_email_query = $db->bindVars($customer_email_query, ':customersID', $_SESSION['customer_id'], 'integer');
$customer_email = $db->Execute($customer_email_query);
and then changing the link to:
https://DOMAIN.TLD/set.php?user=USERNAME&connector=SHA1STRING&action=sendInvitation&targetMail=' . $customer_email; . '&delay=DAYS
but that gives me a Object of class queryFactoryResult could not be converted to string error.
I also tried
https://DOMAIN.TLD/set.php?user=USERNAME&connector=SHA1STRING&action=sendInvitation&targetMail=' echo $customer_email; '&delay=DAYS
but that gave a unexpected T_Echo
I might be missing the obvious but i can not see what i am doing wrong or what i am forgetting to why it won't work...
Any help appreciated.