Genius Posted April 20, 2004 Posted April 20, 2004 HI , Please could someone help me with some code help. basically i am trying to fix my tell a friend e-mails i have the e-mails come to me as an html format.. but when i get them i do not get the name of who sent the e-mail and i do not get the name of the product instead i get %s in the mail like this: Hi %s! Your friend, %s, thought that you would be interested in this item: %s from %s. To view the product click on the link below or copy and paste the link into your web browser: %shttp://onlinestore/catalog/product_info.php?products_id=252&osCsid=ca30944411f820e1cb557e5a044a83a6 Regards, %s this is if i have my code as FALSE if (EMAIL_USE_HTML == 'false') { $email_body = $html_email_text; If i set it to TRUE i get the html email with the correct name but i do not have a link to the product it just shows as a static text rather than a link.. would really appreciate your help. thanks
peterr Posted April 20, 2004 Posted April 20, 2004 Hi, I may have completely misunderstood what you need, but a link in html, the way you need it would be of the format: <a href='http://onlinestore/catalog/product_info.php?products_id=252&osCsid=ca30944411f820e1cb557e5a044a83a6'> http://onlinestore/catalog/product_info.php?products_id=252&osCsid=ca30944411f820e1cb557e5a044a83a6</a> Peter
AlanR Posted April 20, 2004 Posted April 20, 2004 Hi, I may have completely misunderstood what you need, but a link in html, the way you need it would be of the format: <a href='http://onlinestore/catalog/product_info.php?products_id=252&osCsid=ca30944411f820e1cb557e5a044a83a6'> http://onlinestore/catalog/product_info.php?products_id=252&osCsid=ca30944411f820e1cb557e5a044a83a6</a> Peter That would hard code a session id into the email which results in future problems. This is what you want. <a href='http://onlinestore/catalog/product_info.php?products_id=252'> http://onlinestore/catalog/product_info.php?products_id=252</a> Never email a link with a session id. Search the board for duplicate sessions. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)
peterr Posted April 20, 2004 Posted April 20, 2004 Hi, That would hard code a session id into the email which results in future problems. The original poster gave the example with the session ID, so that's how I supplied the solution. :D It's up to the original poster, if they want to put it in emails,etc. Peter
Genius Posted April 21, 2004 Author Posted April 21, 2004 Hi guys, thanks for your suggestions. But buy doing the above, because i cannot tell what product the customer we tell a friend about, the above would not really work in an ideal situation.. so i have managed to solve it.. with the following: in my catalog/ tell_a_friend $email_body .= sprintf(TEXT_EMAIL_INTRO, $HTTP_POST_VARS['friendname'], $from_name, " " . $HTTP_POST_VARS['products_name'], STORE_NAME) . "\n"; then in my english/tell_a_friend. define('TEXT_EMAIL_LINK', '<br><br>To view this product click on the product name below:' . '<br><br>' . '<a href =%s>'. $HTTP_POST_VARS['products_name']. '</a>'); AS you can SEE that the TEXT_EMAIL_LINK referrence to the product name so when you receive an e-mail you will see the product name rather than the long URL link.. and the best part is that the link works... I hope this can help someone too and thanks for your help guys.. do appreciate it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.