Contributions
Newsletter & Subscribers
The purpose of this module is to bridge a gap in the current OSCommerce application.
At present only registered persons can choose to receive the newsletter. The goal of this module is to allow visitors who would not want to register or purchase at present to register to receive the store newsletter.
Process
-------
The process of the module is the following
catalog side
------------
The module provides the possibility for a visitor
-> to register to receive the newsletter. (all infos stored in a new table called subscribers)
-> to manage his registration throught a screen (modify info received and unsubscribe)
-> to have access (if registered) to the subscription center through the "my account" page.
admin side
------------
The module provides the possibility for the store admin
-> to view and edit the subscribers info. (blacklist some users in order for them not to receive newsletters even though they are registered)
-> to manage the newsletters to be sent.
-> to manage the dynamic headers, footers, and unsubscribe links to be added to the body of the newsletter.
-> to synchronise info between customers table and subscribers table (optional)
Expand All / Collapse All
Newsletter & Subscribers for 2.3 with FULL PACKAGE
In need is integration of WYSIWYG html support. Perhaps contribution http://addons.oscommerce.com/info/1347 is the solution, but I have yet to integrate this feature.
I believe there is a bug in the code as pointed out in post #318 in the support forum at http://forums.oscommerce.com/index.php?showtopic=116105
If the next user could confirm if I am right, please alter the source code and upload the new version for others.
Also, here's how newsletter sending should proceed EACH TIME you send a newsletter:
1. Update the database via the 'Update Table' link in Admin
2. Send the newsletter
The first time you send a newsletter you need to define languages via the 'Newsletter Default' link in Admin.
These instruction might be added to installation instructions.
Lastly, the installation instructions claim to use a file CATALOG>newsletters.php but I don't believe it does.
I am sorry I am unable to test further due to time constraints (I am a student ... ;) and I am sorry to be posting 'talk' in the 'package' section of this contribution!
Warm Regards
I have re-uploaded the previous package without modification.
Full package as per 15 Jun 2009 contribution
Updated installation.txt, no code changes
Agreed with Techgoddess that newsletters table should remain in the database and have removed the instruction to drop that table.
Clarified ambiguous english and added basic instruction to improve admin links.
1) Super tiny change in the area of admin/includes/modules/newsletters/newsletters.php. A curly bracket "}" on line 425 -OF THE INSTALLATION.TXT FILE- was missing and causing "Parse error: syntax error, unexpected ';', expecting T_FUNCTION in ~".
2) Super tiny change in the area of admin/includes/modules/newsletters/product_notification.php. A curly bracket "}" on line 568 -OF THE INSTALLATION.TXT FILE- was missing.
3) Included the "Unsubscribe link in emails not working" contribution directly below by sunrise99 involving "newsletters_subscribe.php".
4) Added Spanish translations using "Word Magic Translator Professional (not affiliated with them). This is an excellent translation software but SOFTWARE non-the-less. I do not guarantee complete accuracy.
Just a *note*: Step 2 in the installation.txt file asks you to drop the Newsletters Table from SQL. I did this but received errors every time I clicked on the Newsletter section in Admin. I don't know if there is a viable reason for this step as I haven't received any errors after adding the Newsletters Table back but if anyone else needs to recreate the newsletters table, see SQL code below.
Luck!
Athena
http://www.mediosecologicos.com
=================================================
CREATE TABLE newsletters (
newsletters_id int NOT NULL auto_increment,
title varchar(255) NOT NULL,
content text NOT NULL,
module varchar(255) NOT NULL,
date_added datetime NOT NULL,
date_sent datetime,
status int(1),
locked int(1) DEFAULT '0',
PRIMARY KEY (newsletters_id)
);
==================================================
~~FULL PACKAGE~~
update for Unsubscribe link in emails not working and double email sending.
Only one file update. newsletters_subscribe.php
If your having problems when sending mail, and receiving an error message such as:
Warning: Missing argument 3 for newsletter_subscribers() in /customers/..../newsletter_subscribers.php on line 16
Warning: Missing argument 4 for newsletter_subscribers() in /customers/..../newsletter_subscribers.php on line 16
Warning: Missing argument 5 for newsletter_subscribers() in /customers/..../newsletter_subscribers.php on line 16
Warning: Missing argument 6 for newsletter_subscribers() in /customers/..../newsletter_subscribers.php on line 16
Then you need to replace admin/newsletters.php with the following file.
As i found this fix in another forum post I am unsure of what has been changed. However it works. Bear in mind to TEST your e-mails on only your own e-mail account before sending to your customers. They appear alot different when e-mailed than how they do on the preview screen.
The unsubscribe link wasn't working for me when clicked in the mail received by visitors. It added an "UNSUBSCRIBE" word juft before the mail causing problems (the visitor email didn't disappeared fom my DB)
I figured out the mail was sent in
newsletter_subscribe.php.
Then I replaced in line 54 :
$message .= EMAIL_WELCOME . CLOSING_BLOCK1 . CLOSING_BLOCK2 . CLOSING_BLOCK3 . UNSUBSCRIBE . $HTTP_POST_VARS['Email'] ;
WITH
$message .= EMAIL_WELCOME . CLOSING_BLOCK1 . CLOSING_BLOCK2 . CLOSING_BLOCK3 . $HTTP_POST_VARS['Email'] ;
mail(strtolower($HTTP_POST_VARS['Email']), EMAIL_WELCOME_SUBJECT, $message, "From: " . EMAIL_FROM);
==> Just took off the "UNSUBSCRIBE ."
>>>IT WORKS now.
BE CAREFUL : I'm a complete newbie. I solved this only using logic and thought about sharing it.
That said, don't use it if you don't have this problem!
PS : Nothing more in attached file.
in this package you will get the error while creating new news letter that
ERROR: newsletter module required
replace the code in catalog/admin/newsletters.php
FIND :
if (empty($module)) {
$messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
$newsletter_error = true;
}
REPLACE with :
if (empty($newsletter_module)) {
$messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
$newsletter_error = true;
}
thats it!!!!!!
The latest contribution does not work entirely well. It depends upon you clicking the admin/newsletters.php link first. Now, this is usually the case when you go into the admin screen and click on 'Newsletter' link on the left column. However, this link does not referr to newsletters.php, instead it gives, for example:
www.your-domain.com/catalog/admin/categories.php?selected_box=newsletter
to make it read, instead
www.your-domain.com/catalog/admin/newsletters.php?selected_box=newsletter
you simply have to replace in admin/includes/boxes/newsletters.php:
$heading[] = array('text' => BOX_HEADING_NEWSLETTER,
'link' => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=newsletter'));
with:
$heading[] = array('text' => BOX_HEADING_NEWSLETTER,
'link' => tep_href_link(FILENAME_NEWSLETTERS, 'selected_box=newsletter'));
and thats it!
The file newsletter_update seems to be out-of-date or contain all sorts of unnecessary code which is not relevant to the update function.
I have taken the relevant code and put it at the start of admin/newsletters.php, attached. This means that when you go to Newsletter Admin, the subscribers tables are automatically updated. So you can remove the link 'Update Tables' from the left-hand Newsletters menu.
The precedent package is buggy : Beware of admin/newsletters.php, because the modifications are incomplete (Correct in in .53, then compare...)
v0.54
Updated
adminincludesboxesnewsletters.php hidden 2 boxes (admin,header,footer)
Updated from bobbymac idea
admin/includes/languages/english.php
commented
define('HEADING_INFOS_TITLE','Newsletter Management');
define('HEADING_TITLE','Newsletter');
UPDATED till 15.october 2005
New package and install method (same it's just more comapct)
newsletter v.053a
- BUG FIX admin/includes/classes/email.php
took out the <br> in regular emails causing them to jumble on accident.
newletters should be missing the <br> on purpose to it looks like you design it.
- New code for column left hides newletter box when logged in since it does registered users no
good anyway!
IMPORTANT EMAIL FIX INCLUDED:
admin/includes/classes/email.php
CHANGE:
$this->html = tep_convert_linefeeds(array("rn", "n", "r"), '', $html);
TO THIS:
$this->html = tep_convert_linefeeds(array("rn", "n", "r"), '<br>', $html);
FULL VERSION ATTACHED
- Bug fix: When you subscribe after already being in the database and you had unsubscribed at one point, you were not getting resubscribed. Fixed now. However if you are a registered user and login and unsubscribe you still cannot subscribe from the main page or left column you have to login.
- Fixed broken unsubscribe link in emails
- Fixed multiple other broken links
- Translated SQL and admin/english files to english using translation by hotnuts21
- Updated admin/newsletters_subscribers_view.php by Sujoy Dutta (PHP 5 fix)
- Updated instructions for install, they are more detailed on what files need modified or copied not instead of just "check all files for updates"
- Added some documentation on how this thing works.
QUESTIONS & ANSWERS GO TO THE FORUM:
http://forums.oscommerce.com/index.php?showtopic=116105
Sorry there is a error in my last posting .Please read then
you just replace the cataloga//dmin/newsletters_subscribers_view.php file by the attach file.
in place of
you just replace the catalogadminnewsletters_subscribers_view.php file by the attach file.
So I again upload the requre file which is same with my last posted file.
If you use php5 then you get a error in newsletters_subscribers_view.php file
.the error is like that
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:Apache2htdocsoscommercecatalogadminnewsletters_subscribers_view.php on line 341
Warning: reset() [function.reset]: Passed variable is not an array or object in C:Apache2htdocsoscommercecatalogadminincludesclassesobject_info.php on line 17
Warning: Variable passed to each() is not an array or object in C:Apache2htdocsoscommercecatalogadminincludesclassesobject_info.php on line 18
then you just replace the catalogadminnewsletters_subscribers_view.php file by the attach file.
this zip file content only newsletters_subscribers_view.php. file
It seems what the 'subscription_center.php' is missed in the contribution.
The following link
'http://yursite.com/catalog/subscription_center.php?action=view&email=julia@julia.lviv.ua'
is sending to the new subscribers but there are no such file.
partie admin :
Module update_newsletter :
La mise à jour se fait correctement. Seul pb, tous les clients sont importés dans la table subscribers et tous les clients sont mises à jour.
j'ai laissé l'ancien code au cas ou vous ne souhaiteriez pas mettre à jour ce fichier.
partie catalog
newsletter_unsubscribers_done mise à jour
Dès qu'un client se désabonne via ce module, il se désabonne partie membre et partie anonyme.
Si il n'existe pas en partie anonyme, la partie client n'est pas mise à jour.
Toutefois cela ne pose pas de pb car c'est géré par unsubscribe_done.php.
Update
admin :
update_newsletter.php :
now this files is ok. only pb, all the customers are imported in the subscribers table and all cutomers are updated
I let the old code if you don't wish to update this file
catalog
newsletter_unsubscribers_done ipdated
If a customers want delete this subsciption, he unscubscribe in customers table and anonymous subscibes table
if he don'exist in anonymous subscribe, the customers table is not updated.
but, this pb doesn't important becaus the unsubscribe is managed by unsubscribe_done.php
It is just an update on the files of the English which provokes a bug:
- Admin/includes/languages/english/newsle tters_extra_default
- Admin/includes/languages/english/newsle tters_extra_infos
I forgot to inform to everybody to think of abolishing your newsletters in the admin before installation of the contribution, otherwise it provokes an error SQL because your newsletters former shall not find your intoxicate and in the bottom of pages.
Cordially.
This version is completely modified.
A lot of improvement and of bug abolished are:
- Improvement of the administrator of the news bulletin and the deletion of bug
- Organized of a modifiable design for the height and in the bottom of page three typify of news bulletin
- Possibility of modifying your bottom of page and height of page on your news bulletins
- Automatic Link so that the customer abolishes his registration
- Integration of the wysiwyg.
- Modification of the code of the boxing on the catalog for a correct posting.
I council to compare well your codes to make the previous update of the versions and read the note.
Sorry,
2 files missing in the latest contribution : ok now
Sorry,
2 files missing in the latest contriution : ok now
Just a little modification in english catalog language
Just little modification in 2 files in catalog
...../languages/english/newsletter.php
...../boxes/newsletter.php
Oups ! A little error on the last version
Just a little modification in the files.
Files optimisation in admin
Delete the fields no importants
Update sql in newsletter_update
Newsletter v0.41
Forget 2 files
Minor update on sql query.
more modifications in files catalog/newsletters.php and admin/newsletter_update.php
Modification sql database.
class deleted.
Newsletter Module v 0.3_beta4
Some modifications included in files
Bugs are been corrected.
included wysiwyg htmlarea
included admin access level (old code can be removed).
http://forums.oscommerce.com/index.php?showtopic=116105
Newsletter Module v 0.3_beta3
Some modifications included inside.
Wysiwyg integrated
Problem resolved with the sheet creation in the newsletter.
Thanks you for this add on.
I updated for ms2.
If you want install this new module, use a compare utilities.
Bug Know :
When you send a newsletter subscriber, the status sent is not updated
When you send a newsletter with a sheet (you have an example to test ==> test_newsletter.txt), you have
a big problem when you receive the newsletter. Seral <p> are created between the <table>.
I don't kown why, but this is problem of oscommerce.
I try to search the problem (see html_output or mime.php), i haven't success to solve it.
Otherwise the contribution work fine.
If you found a solution, please let me a comment in the forum :
http://forums.oscommerce.com/index.php?showtopic=116105
see Newsletter & Subscribers Module v 0.1 contribution for complete description of this module.
This new version fixes a few bugs and update
some install files
added some admin functionalities
see readme for details
The purpose of this module is to bridge a gap in the current OSCommerce application.
At present only registered persons can choose to receive the newsletter. The goal of this module is to allow visitors who would not want to register or purchase at present to register to receive the store newsletter.
Process
-------
The process of the module is the following
catalog side
------------
The module provides the possibility for a visitor
-> to register to receive the newsletter. (all infos stored in a new table called subscribers)
-> to manage his registration throught a screen (modify info received and unsubscribe)
-> to have access (if registered) to the subscription center through the "my account" page.
admin side
------------
The module provides the possibility for the store admin
-> to view and edit the subscribers info. (blacklist some users in order for them not to receive newsletters even though they are registered)
-> to manage the newsletters to be sent.
-> to manage the dynamic headers, footers, and unsubscribe links to be added to the body of the newsletter.
-> to synchronise info between customers table and subscribers table (optional)
Note: Contributions are used at own risk.