You are on page 1of 5

****************************************************************************** ****************************************************************************** Zencart Addon: Newletter Subscribe v 2.1.1 for Zen Cart v1.3.

8a Designed for: Zen Cart v 1.3.0x by Sara Jacobson (NotGoddess) Modifications made 1-1-2009 on zen cart 1.3.8a - see ns_changelog for details Modification made 5/16/2010 for zen cart 1.3.9b - see ns_changelog for details Based on: Zencart Addon: Subscribe! v 1.1 Written by Denise McLaurin (design@unicornhosting.com) Zen Forum PM: dmcl1 (that's DMCL-ONE) Zencart Addon: Subscription_Removal v 1.1 Written by Chris Boedigheimer (chris@webignite.net) Zen Forum PM: badd Adapted by Sara Jacobson (sarazc@notgoddess.com) Zen Forum PM: NotGoddess Donations: for Sara Jacobson: donations@notgoddess.com via PayPal (if you want to send a check, email and I can give you an address). Or you can donate to the ZenCart developers at: http://www.zen-cart.com/index.php?main_page=infopages&pages_id=14 (if link is broken, goto zen-cart.com and click 'donate' link. Please address comments/questions to the following Zen Forum Contribution Thread: http://www.zen-cart.com/forum/showthread.php?p=209263 =============================== Purpose/Method: =============================== Allow potential customers to subscribe for newsletters without needing to create an account. Involves creation of separate database table which tracks all newsletter-only subscribers and all customer accounts with a newsletter subscription. Any changes made to customer accounts (email address, email format, cancel subscription) are correctly edited in the new table. Former newsletter-only subscribers who later decided to create an account are identified and updated so that multiple records will not exist for the same email address. Newsletter only subscribers are required to confirm their email prior to receiving newsletters (in hopes of preventing spam/bots/jokes). Includes Subscription management page under Customers -> Subscription Manager =============================== UPGRADING FROM PRIOR VERSION =============================== From Subscribe! ZC1.2.7 : Note: This contribution is not compatible 'as is' with 1.2.7! If you tried to install the 1.2.7 contribution in 1.3.x: A number of files have been changed/removed, so I don't really advise trying to upgrade-a fresh install is best.

From v2.0 to 2.0.1 (or 2.0.1a): See the ns_changelog.txt file included in this contribution for details on changed files. In most cases you can just overwrite the changed files. From v2.0.2 to v2.0.3: See the ns_changelog.txt file included in this contribution for details on changed files. In most cases you can just overwrite the changed files. From v2.0.3 to v2.0.4: Just overwrite the files. No database changes needed. From v2.0.4 to v2.0.5 or v2.0.6: Overwrite the files, or just the changed files: admin/includes/functions/extra_functions/subscription_manager.php admin/subscription_manager.php When you log into the subscription manager you should see an 'update' button that will perform the database update (see changelog for details) From v2.0.5 or v2.0.6 to v2.0.7: Just overwrite the files. No database changes needed. From v2.0.5, v2.0.6, v2.0.7 to v2.0.8: Just overwrite the files. No database changes needed. From v2.0.5, v2.0.6, v2.0.7, v2.0.8 to v2.0.9: Just overwrite the files. No database changes needed. From v2.0.5, v2.0.6, v2.0.7, v2.0.8 , v2.0.9 to v2.0.9a: Just overwrite the files. No database changes needed. From v2.0.5, v2.0.6, v2.0.7, v2.0.8 , v2.0.9, v2.0.9a to v2.1.0: Just overwrite the files. No database changes needed. Note: v2.1.0 is for Zen Cart v1.3.8 and should not be used with previous versions. =============================== BACKUP PRIOR TO INSTALL =============================== 1. BACKUP, BACKUP, BACKUP! This contrib involves creation of a new database table and modification of the query_builder table. PLEASE backup your database before applying the changes. 2. Modifications are made to the following core files: admin/index.php admin/customers.php includes/functions/function_email.php includes/functions/audience.php includes/modules/pages/account_edit/header_php.php includes/modules/pages/account_newsletters/header_php.php includes/modules/pages/unsubscribe/header_php.php It is HIGHLY SUGGESTED that you make backup copies of these files in case you later want to remove the contribution. All changes in the above-named core files are wrapped with this comment: // BEGIN Zenlite Mailing List mod and // END Zenlite Mailing List mod

If you have made other changes to the core files mentioned here, I highly recommend using a diff utility program, such as WinMerge (http://winmerge.sourceforge.net/) to merge the files together. Where possible, template overrides have been used. =============================== INSTALL -- FILE UPLOAD =============================== 1. Download the package and unzip to a temp directory. 2. Copy the "admin" folder to your zencart root folder. This will overwrite admin/index.php and admin/customers.php, and add new files. (The index.php is only changed to display the count of "Newsletter Subscribers" as both customer subscribers and newsletter-only subscribers on the Admin Home page.) 3. Copy the "email" folder to your zencart root folder. This will add the email template used by the subscription. 4. Prior to copying the "includes" folder, open includes/templates and rename the "YOUR_TEMPLATE" subdirectory to the name of the template you are using. 5. Copy the entire "includes" folder to your zencart root folder. The files are already arranged with appropriate subdirectory structure. As stated above, certain files WILL be overwritten. 6. Change the permissions setting for the following to 777: includes/languages/english/html_includes/YOUR_TEMPLATE/define_subscribe .php includes/languages/english/html_includes/YOUR_TEMPLATE/define_unsubscri be.php (Note! for security, after you have these configured the way you like, set permissions to 644. 7. Log into your admin panel and in the Customers tab you should see the option 'Subscription Manager'. Click on this. 8. You should get a warning at the top that the contribution has not been installed, and below you'll see an 'install' button. Click on this to install the tables and update sql queries. If you have installed version 2.2 you should see a 'update' button instead of an 'install' button. BACKUP your subscriptions table! Then press the 'update' button. That should be it! The installation should transfer existing customer subscribers over, so you will see them immediately. =============================== USAGE INSTRUCTIONS =============================== In addition to the subscription manager are other configuration options. Under 'Configuration -> My Store' you will see the option to enable/disable subscriptions. Subscriptions are enabled by default when the contribution is installed, however you can temporarily disable them with this command. This is handy when you want to prevent subscriptions, but do not want to

completely remove the contribution (doing so deletes all subscriptions, as it drops the table entirely). Under 'Configuration -> E-mail Options' near the bottom you should see three new options: Send Notice of Newsletter-only Subscriptions To - Status 1 = send notices, 0 = do not send notices Send Notice of Newsletter-only Subscriptions To enter email address(es) you want notified of new subscriptions Newsletter Test Group Email Enter email addresses of customer or newsletter-only subscribers you are using as your 'test' groups. Under 'Tools -> Send Email' you'll see new customer groups: Email Test Group - Customers Email Test Group - Newsletter-only subscribers These two fields pull the correct emails you designated in your Newsletter Test Group Email settings. Newsletter Subscribers Customer Account Newsletter Subscribers Newsletter-only Subscribers If I need to explain these, let me know. :) Under 'Tools -> Layout Boxes Controller' you'll find the sidebox, which you can arrange just as you would any sidebox. Under 'Configuration -> Layout Settings' you'll see and option to show the subscription field in the header. In order to use this option you will need to edit your tpl_header.php file in your template and add the following: <?php // BEGIN Zenlite Mailing List mod 1/1 if(defined('NEWSONLY_SUBSCRIPTION_ENABLED') && (NEWSONLY_SUBSCRIPTION_ENABLED=='true') && (NEWSONLY_SUBSCRIPTION_HEADER=='true')) { include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_SUBSCRIBE_ HEADER)); } // END Zenlite Mailing List mod 1/1 ?> The checks are there to ensure the cart doesn't error out if the contribution is not installed/enabled. You'll find an example placement of this code in /includes/templates/YOUR_TEMPLATE/common/tpl_header.php.example NOTE: PLEASE do not directly copy the example header over your own. It is only there as an example-you need to edit your header to add the code above. =============================== IMPORTING E-MAILS FROM A FILE: =============================== I've tested the import script with a list of 2500 emails and it went without problems, but if you have very large lists, you might want to take care.

Use the file selector to select the file to import. Indicate how fields are separated (\t for tabs, , for commas, etc) If the fields are wrapped in quotes, fill in that field. Enter a sample record. This lets the import script know what fields to import. Use NULL for fields not to import, 'email' for the address, and 'format' for format. Adding format is optional-you can specify a default. Note that you don't have to enter the entire record. If each record is 10 fields long, but email is the first field, just enter: email NULL If email was the third field, and format the second, enter: NULL format email NULL If there is a header row (excel files often have them), check the box and the first row will not be imported. Indicate the fallback email format to use if there is none in the record, or is not 'HTML' or 'TEXT' (the check is case-insensitive-'html' is okay) Cross your fingers, hold your breath and submit. =============================== EXPORTING E-MAILS TO A FILE: =============================== There is a very good contribution for exporting email addresses in the ZenCart -> Downloads -> Admin Tools section called 'Email Address Exporter ' Please use this to backup your subscribers table before importing or updat ing. =============================== REMOVAL =============================== The 'remove' option in the Subscription Manager will remove contribution chan ges from the database, but it does not remove/alter files. If you remove this yo u'll need to restore your backup files (you DID make backups, correct?). Note that the remove option also DELETES/DROPS the subscribers database, so m ake sure you have a backup of that table before you remove. The contribution is created with checks so it uses standard ZenCart methods w hen not enabled. dmcl1: ENJOY!! -- I'll be interested to know if you find it helpful! notgoddess: ditto :) sparrish: likewise ;) stellarweb: great mod!

You might also like