Guest Posted April 30, 2004 Share Posted April 30, 2004 kymation, before I go into the trouble of trying out your release, I think it would benefit everyone if you were to please list all the changes you've made. many of the directories in your release are empty, and I don't know If that's deliberate or not. Have you found a fix for the problem I had - the contribution passed the sID as part of the email address, and returned an error with every unsubscribe atempt. -Ethan Quote Link to comment Share on other sites More sharing options...
♥kymation Posted April 30, 2004 Share Posted April 30, 2004 The empty directories are just a result of getting the language file in the right place. They are "empty" because there are no files in those directories that are relevant to this contribution. Yes, this should fix the problem that you noticed. If you have already installed the previous version, just drop in the unsubscribe.php and unsubscribe_done.php and your mod should work. If you really want the changes: In unsubscribe.php, modified the call to tep_href_link to properly pass the email address when SIDs are in use. In unsubscribe.php and unsubscribe_done.php, added checking of the input data to prevent hacking via SQL injection. In the readme, updated instructions to put the defines for filenames in includes/filenames.php, and added the define for unsubscribe_done.php. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Guest Posted May 5, 2004 Share Posted May 5, 2004 (edited) Jim, Your contibution worked, thank you! I did, however, have to make a few changes, which I beleive should be made public as the next version: 1. in order for the link in the email to work, you must add the following lines to admin/includes/filenames.php: //// Begin Unsubscribe hack ? define('FILENAME_UNSUBSCRIBE', 'unsubscribe.php'); //// End Unsubscribe hack 2. sdtep 2 of the readme creates a link which is missing the /catalog/ part of the URL. to fix this, replace $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . HTTP_CATALOG_SERVER . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address']); with $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address']); Also, if you're sending out HTML base emails, as I am, you may want to change the function call from add_text to add_html. In order to make the link clickable in an HTML email, as well as in non-HTML email clients, replace $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address']); with $mimemessage->add_html($this->content . TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>'); 3. again in the readme, you left the line that advises on how to check if it works with the mistake it had in it. that is, it says ? ? UPDATE customers SET customer_newsletter = '2' where customer_newsletter = '1' instead of ? ? UPDATE customers SET customers_newsletter = '2' where customers_newsletter = '1' other then that (and those are really minor fixes), It works like a charm! I think a new version ought to be made with the fixes I proposed. If you prefer, I'll make it. -Ethan Edited May 5, 2004 by Ethan1701 Quote Link to comment Share on other sites More sharing options...
♥kymation Posted May 6, 2004 Share Posted May 6, 2004 Thanks for the update. You seem to have caught all of the things that I forgot to mention. Please do put this up as an update to the contribution, as I'm sure that others will need it as well. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
edtiger Posted May 6, 2004 Share Posted May 6, 2004 this mode fails on my install when using search engine safe urls. When the url is transferred from unsubscribe.php to unsubscribe_done.php the url changes from [email protected] into something like email/[email protected] and the database query fails as a result. As a work around, I have the link point straight to unsubscribe_done.php, but are there any thoughts on how to get this to work regular? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 6, 2004 Share Posted May 6, 2004 Ed, I could never get the search engine safe URLs to work. it would do what you described to every parameter it would pass... I don't know how it's meant to work, but it shouldn't be to hard to fix this.. -Ethan Quote Link to comment Share on other sites More sharing options...
wizardsandwars Posted May 6, 2004 Author Share Posted May 6, 2004 Wow, you guys sure took this a long way, lol. Sorry I havn't had time to continue to support it, but it seems that Jim and Ed have picked up my slack considerably. Thankd guys. Quote ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Guest Posted May 6, 2004 Share Posted May 6, 2004 THat's the beauty of open source (or Free software, as you like). leave the code lieing around, and someone else is bound to use it and make something even better out of it! Glad to have helped. -Ethan (who the fog is Ed?) Quote Link to comment Share on other sites More sharing options...
wizardsandwars Posted May 6, 2004 Author Share Posted May 6, 2004 Opps. Ethan, I mean. Sorry about that. Quote ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
♥kymation Posted May 6, 2004 Share Posted May 6, 2004 Thank you, Chris, for doing most of the work for us. Shure makes the job a lot easier. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
michellez1 Posted July 17, 2004 Share Posted July 17, 2004 Ed, I could never get the search engine safe URLs to work. it would do what you described to every parameter it would pass... I don't know how it's meant to work, but it shouldn't be to hard to fix this.. -Ethan If you're still needing a fix for this, I have a workaround available. Quote Link to comment Share on other sites More sharing options...
qorn Posted July 30, 2004 Share Posted July 30, 2004 Hi Chris I saw on the site http://www.wizardsandwars.com/unsubscribe.php you have a text entry box, so customers can click a link straight to the unsubscribe page and they can enter there email address. Would you post that code here, or are you still developing it?? Kind Regards Dave Quote My Contributions Link to comment Share on other sites More sharing options...
Andrew J Posted August 6, 2004 Share Posted August 6, 2004 Hi! I'm going to intall this mod on my site but my admin/includes/modules/newsletters/newsletter.php page is different cos I have installed WYSIWYG HTMLArea MS2 v1.7 contribution. I dont know how to implement the code changes described in the 2nd installation step. I would like to ask somebody to post back this code with the necessary extra code without losing the WYSIWYG feature. $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer')); // MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Newsletter v1.7 when WYSIWYG Disabled) if (HTML_AREA_WYSIWYG_DISABLE_NEWSLETTER == 'Disable') { $mimemessage->add_text($this->content); } else { $mimemessage->add_html($this->content); // MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Newsletter v1.7 when WYSIWYG Enabled) } $mimemessage->build_message(); while ($mail = tep_db_fetch_array($mail_query)) { $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title); } Thx in advance, Andrew Quote Link to comment Share on other sites More sharing options...
Andrew J Posted August 13, 2004 Share Posted August 13, 2004 :( Any idea? Quote Link to comment Share on other sites More sharing options...
Andrew J Posted August 24, 2004 Share Posted August 24, 2004 Pleeease! :( Quote Link to comment Share on other sites More sharing options...
osCshop Posted January 4, 2005 Share Posted January 4, 2005 I'm also using the WYSIWYG HTMLArea MS2 v1.7 contribution. Would anybody be so kind to give the code to implement this nice unsubscribe contri together with WYSIWYG please? If I use it like this: function send($newsletter_id) { $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'"); $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer')); // MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Newsletter v1.7 when WYSIWYG Disabled) if (HTML_AREA_WYSIWYG_DISABLE_NEWSLETTER == 'Disable') { $mimemessage->add_text($this->content . TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">here</a>'); } else { $mimemessage->add_html($this->content . TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">here</a>'); // MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Newsletter v1.7 when WYSIWYG Enabled) } $mimemessage->build_message(); while ($mail = tep_db_fetch_array($mail_query)) { $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title); } $newsletter_id = tep_db_prepare_input($newsletter_id); tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'"); } } ?> there's no e-mailadres attached to the link :'( Quote Link to comment Share on other sites More sharing options...
osCshop Posted January 6, 2005 Share Posted January 6, 2005 Anybody, ... PLEASE!?! Quote Link to comment Share on other sites More sharing options...
♥kymation Posted January 6, 2005 Share Posted January 6, 2005 I'm not using the WYSIWYG contribution, so I can't give you any easy fixes. However, something about this is bothering me. Are you actually getting the link in the email, just without the email address? If so, check your code. The variable $mail['customers_email_address'] must be present for this to work, so it should be inserted if the email is working at all. If I have misunderstood, could you post the last part of an email (the part with this link?) I'd like to see what's actually going out. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
osCshop Posted January 7, 2005 Share Posted January 7, 2005 Thanks for the reply. The link shows up in the newsletter but because the e-mailadress is missing it doesn't work. If I click the link I'm going to the url: http://www.mydomain.nl/webshop/catalog/uns...ribe.php?email= As you can see in my code posted earlier I've used the variable "?email=" . $mail['customers_email_address'] . '">here</a>'); But somehow it's not working, something wrong in the coding line? Quote Link to comment Share on other sites More sharing options...
♥kymation Posted January 7, 2005 Share Posted January 7, 2005 Very odd. I don't see anything wrong with your code. The only thing that I can see is that this link will be at the end of the HTML block, after the closing tags. If this has any effect, it should make the entire link disappear or malfunction, not just take the variable away. Try adding the variable into the message earlier, like this: } else { $mimemessage->add_html($this->content . $mail['customers_email_address'] . 'TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">here</a>'); // MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Newsletter v1.7 when WYSIWYG Enabled) Then send a test message. The email address should show up just before the unsubscribe message. If it doesn't, we know something is going wrong with this variable. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
osCshop Posted January 7, 2005 Share Posted January 7, 2005 It gives an error in my Admin: Parse error: parse error in c:\domains\mydomain.nl\wwwroot\webshop\catalog\admin\includes\modules\newsletters\newsletter.php on line 67 Line 67 is (your modified line): $mimemessage->add_html($this->content . $mail['customers_email_address'] . 'TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">here</a>'); Quote Link to comment Share on other sites More sharing options...
osCshop Posted January 7, 2005 Share Posted January 7, 2005 (edited) The error in Admin comes if I submit the Send button to send the newsletter... Edited January 7, 2005 by osCshop Quote Link to comment Share on other sites More sharing options...
osCshop Posted January 9, 2005 Share Posted January 9, 2005 And now? :'( Quote Link to comment Share on other sites More sharing options...
♥kymation Posted January 9, 2005 Share Posted January 9, 2005 There is a typo in the code. Without errors introduced by my fat fingers, it should be: $mimemessage->add_html($this->content . $mail['customers_email_address'] . TEXT_UNSUBSCRIBE . '<a href="' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">here</a>'); Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
osCshop Posted January 10, 2005 Share Posted January 10, 2005 Thanks Jim, I've tryed it but there's no e-mailadress before the unsubscribe message. So something goes wrong with the variable . $mail['customers_email_address'] . But where? :blink: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.