Community Add-Ons
newsletter/maillist email capture add on
for osCommerce Online Merchant v2.2
This is a little bit of code I knocked up to capture email addresses as at present OSC only captures emails if a customer creates an account. version 1
Sorry.. the previous submission comment should read
"Based on 4.0"
nothing to dload in this post.
######################################
# AJAX driven Newsletter box for
# osCommerce 2.2. Allow your visitor
# to subscribe to your newsletter
# without taking them away from the
# current page.
######################################
Based on 1.4
Read the README for more info.
This is a full package.
The admin will now show subscribers from both those who sign up through "newsletter/maillist email capture add on" and through the account creation process.
The admin also shows the total number of subscribers.
If you are upgrading you can just copy these files over the old ones.
Simply mod that displays the actual number of subscribed users, this is easier than looking at how many have subscribed.
Open up catalog/admin/mailinglist_report.php
Find the following at the top:
if ($HTTP_POST_VARS['csv']) $csv_string=$HTTP_POST_VARS['csv'];
if (strlen($csv_string)>0){
header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
header("Last-Modified: " . gmdate('D,d M Y H:i:s') . ' GMT');
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: Application/octet-stream");
header("Content-Disposition: attachment; filename=$savename");
echo $csv_string;
}
else echo "CSV string empty";
exit;
};
And add this straight after:
// Display number of people subscribed
$subscribers_query_raw = "SELECT * FROM `maillist`";
$subscribers_query = mysql_num_rows(tep_db_query($subscribers_query_raw));
Find:
<?php echo HEADING_TITLE; ?>
Replace with:
<?php echo HEADING_TITLE . ' - ' . $subscribers_query . ' Subscribers'; ?>
Done!
If your having problems with the report contribution here please visit ... http://forums.oscommerce.com/index.php?showtopic=235597 and make sure you have all your <? 's
I am providing this add-on that will allow administrators to send a newsletter from Administration-Tools-Newsletter Manager, and which will be sent to both users who have an account as well as users who have only signed up to the newsletter.
Go into catalog/admin/includes/modules/newsletters.php
After:
$copy_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
add:
$copy_query_news = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_NEWSLETTER . " where customers_newsletter = '1'");
And after:
while($row = tep_db_fetch_array($copy_query)) {
if (eregi('^[-a-z0-9._]+@([-a-z0-9_]+.)+[a-z]{2,6}$',$row['customers_email_address'])) {
tep_db_query("insert into " . TABLE_CUSTOMERS_TEMP . " (customers_firstname, customers_lastname, customers_email_address) VALUES ('" . addslashes($row['customers_firstname']) . "', '" . addslashes($row['customers_lastname']) . "', '" . $row['customers_email_address'] . "')");
}
}
add:
while($row = tep_db_fetch_array($copy_query_news)) {
if (eregi('^[-a-z0-9._]+@([-a-z0-9_]+.)+[a-z]{2,6}$',$row['customers_email_address'])) {
tep_db_query("insert into " . TABLE_CUSTOMERS_TEMP . " (customers_firstname, customers_lastname, customers_email_address) VALUES ('" . addslashes($row['customers_firstname']) . "', '" . addslashes($row['customers_lastname']) . "', '" . $row['customers_email_address'] . "')");
}
}
That's it. When you send e-mails from the Newsletter Manager, verify that the "Customers which have not yet received this issue of the newsletter:" number is correct (ie. count up how many in total should be getting this newsletter).
If incorrect, you will have to go into your SQL database, in the "customers temp" table and delete the customers contents in it.
Any problems, catch me on the
forum: http://forums.oscommerce.com/index.php?sho...=235597&hl=
This contribution is a great idea, however it was missing the function mirror_out and wasn't working without it.
I have attached the full Maillist Report v1.1 which has been updated with the missing function in maillist_report.php. The install guidelines are still the same.
All credit to pafranklin for this great contribution!!
Modification based on Newsletter/Maillist version 4.0
I've modified only main newsletter.php and newsletter.php from language directory, to make it more localized.
I've replaced subscription SEND button (was almost imperceptible) by standard CONTINUE button.
If you want to see how it looks like, please visit: http://amber-style.com/newsletter.php
In package you can find only main newsletter.php file and English and German language files.
This is a small add on that I have built to provide an admin report of the people sucsbribed to the Newsletter (Maillist).
This is my first contribution and I am sure that it can be improved on but it works well for me.
COMPLETE PACKAGE
Credit goes to original authors. I did some various coding cleanup, and made some improvements to the existing contribution.
For those already using version 3.0+, to upgrade simply download this full version, backup original files, uncompress into corresponding folders, upload, and you are done!
Changes made to all previous files as follows:
Maillist version 4.0 - 8/12/2006
- Added automated confirmation emails for subscribing and unsubscribing.
- Added additional DEFINE statements in language files for automated emails, including French translation via babelfish.altavista.com.
- Removed various coding that was not necessary for this system: i.e. last batch of updates included dynamic meta tags call not found in pages and dynamic call to <? echo THEMA_STYLE;?> style sheet which produced errors.
- Creation of a graphical infobox version of the /includes/boxes/newsletter.php page.
- Revised page header on /newsletters.php to match default oscommerce page formatting.
- Revised installation instructions and added upgrade instructions.
Complete package with the two previous updates added. Installation file in english. (Back up your files first and use at your own risk).
Petit update: avec la version 3.0, un utilisateur inscrit à la mailing list et qui crée un compte par la suite sans vouloir la newsletter ne sera pas enlevé de la mailing list.
Avec cet update, tout nouveau compte créé effacera automatiquement l'adresse correspondante de la mailing list.
Attention, le fichier inclu ne contient que l'info pour l'update!
Quelques modifications a apporté a la version mailling list V2.0
* Ce supplément permet d'eviter le double emploi entre la newsletter de OSC et cette contribution.
* Ainsi un invité créant un compte plus tard et s'abonna a la newsletter de OSC sera supprimé de la mailling list.
* Un client avec un compte qui souhaite s'enregistrer a la mailling list le pourra uniquement s'il n'est pas déja inscrit a la newsletter.
Ces modifs permettent donc une compatibilité parfaite entre cette contribution et la newsletter par défault dans OSC.
Ce package est destiné a une version ms2 de OSC, et contient uniquement un fichier text avec les modifications a apporté suite a l'install de cette contrib.
Bon code a tous
decad7
Cette contribution permet a n'importe quel visiteur de pouvoir s'inscrire a la newsletter sans avoir a créer un compte
Dans la box information un lien newsletter est ajouté : celui renvoie sur une page ou le visiteur peut s'abonné ou se
désabonné a la newsletter. Il lui suffit de rentrer son adresse email
Bugs corrigés :
- Lorque que le client se désabonnait son adresse n'etait pas effacée.
- Si le client s'abonnait deux fois par mégarde la page renvoyait une erreur.
- Traduction en FR
- Popup transformé en page newsletter.php
- Page retravaillée pour améliorer le look de la boutique.
Merci a Fissiaux pour son aide
Correction for silly error in sql statement
This is a little bit of code I knocked up to capture email addresses as at present OSC only captures emails if a customer creates an account. version 1
