Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter & Subscribtion for MS2


Gyakutsuki

Recommended Posts

Hi Daniel,

 

Well, it's not working again.  :(  Everyone I asked to test it said they can register no matter what they put down for the email address. So the validation dosn't work.

 

Nope, ... everytime I tried it, the validation did work. :)

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mp3shop4/public_html/includes/languages/english/newsletters.php on line 31

 

Line 31 of that file says:

 

define('CLOSING_BLOCK1', 'This email was sent to:');

 

There is nothing wrong with the line 31 you have posted, so it is a line just before. Might be easier if you email me the file.

 

Peter

Link to comment
Share on other sites

  • Replies 336
  • Created
  • Last Reply

Top Posters In This Topic

Hello,

 

I was having the same problem, looked into this forum yesterday but could not find a good answer. looked into this forum today and saw you struckling with the T_CONSTANT_ENCAPSED_STRING . I did so but found the issue. The line above 31 is your troublemaker. If you start counting the ' ' then you'll see your having 1 to much. you have to remove the last one in the line before the '); this should do the trick.

 

rgds,

Perry

 

 

Hi Daniel,

Nope, ... everytime I tried it, the validation did work.  :)

There is nothing wrong with the line 31 you have posted, so it is a line just before. Might be easier if you email me the file.

 

Peter

Link to comment
Share on other sites

  • 3 weeks later...
Well, it's not working again.  :(  Everyone I asked to test it said they can register no matter hwat they put down for the email address. So the validation dosn't work. So what I decided to do was to reinstall the contribution on the catalog side (I left the admin side alone) but now it says this again and I don't rmeember what I did last time (even though I wrote it in this topic but wasn't sopecific enough):

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mp3shop4/public_html/includes/languages/english/newsletters.php on line 31

 

Line 31 of that file says:

 

define('CLOSING_BLOCK1', 'This email was sent to:');

 

Any ideas...again?

 

THANKS,

Daniel

 

 

Hello all,

 

I have exactly the same problem but I don't know which . "\n\n" . I have to change ...

 

Could somebody please be so gently and send me his/her +++working+++ file as PM?

 

Thanks in advance!

Cheers

 

+++ http://www.muehlkoppe.de +++

Link to comment
Share on other sites

Oh, thanks. It's done :P

 

I just changed the last row from

 

define('EMAIL_WELCOME1', 'We welcome you to ' . STORE_NAME . '! You will now receive on a monthly basis our newsletter and we will share with you more discoveries about .... Some of these services include:' . "\n\n" . '* Palm Culture ' . "\n" . '* Special offers..' . "\n" . '* Palm culture advices' . "\n" . '* If you would like to contribute or write an article for one of our newsletters, do not hesitate to contact us . You can as well use the online form in order to submit your article and pictures. (The newsletter online form link is located in the section Newsletter of our site).' . "\n\n" . 'For help with any of our online services, please email our Service Center : ' . STORE_OWNER_EMAIL_ADDRESS . ' or use our online feedback forms (under the Contact Us icon).' . "\n\n" . 'We are happy to have you as a member of our community. Your email address and interest preferences have been recorded on our site. In the future, you will receive periodic emails specific to your interests.' . "\n\n" . 'Privacy is important to us; therefore, we will not sell, rent, or give away your name or address to anyone. At any point, you can select the link at the bottom of every email to unsubscribe, or to receive less or more information.' . "\n\n" . 'Thanks again for registering, and please visit ' . STORE_NAME . ' soon! If you have any questions or comments, feel free to contact us.' . "\n\n"'); 

define('CLOSING_BLOCK1', 'This email was sent to:');

 

into

 

define('EMAIL_WELCOME1', 'We welcome you to ' . STORE_NAME . '! You will now receive on a monthly basis our newsletter and we will share with you more discoveries about .... Some of these services include:' . "\n\n" . '* Palm Culture ' . "\n" . '* Special offers..' . "\n" . '* Palm culture advices' . "\n" . '* If you would like to contribute or write an article for one of our newsletters, do not hesitate to contact us . You can as well use the online form in order to submit your article and pictures. (The newsletter online form link is located in the section Newsletter of our site).' . "\n\n" . 'For help with any of our online services, please email our Service Center : ' . STORE_OWNER_EMAIL_ADDRESS . ' or use our online feedback forms (under the Contact Us icon).' . "\n\n" . 'We are happy to have you as a member of our community. Your email address and interest preferences have been recorded on our site. In the future, you will receive periodic emails specific to your interests.' . "\n\n" . 'Privacy is important to us; therefore, we will not sell, rent, or give away your name or address to anyone. At any point, you can select the link at the bottom of every email to unsubscribe, or to receive less or more information.' . "\n\n" . 'Thanks again for registering, and please visit ' . STORE_NAME . ' soon! If you have any questions or comments, feel free to contact us.' . '"\n\n"'); 

define('CLOSING_BLOCK1', 'This email was sent to:');

 

Have fun!

Cheers

 

+++ http://www.muehlkoppe.de +++

Link to comment
Share on other sites

Hello all, just installed latest version v048 and now have a following question and comment:

 

1. comment - there is 'firstname' missing in mysql in newsletter_subscripe.php

 

2. question: I have no problems to subscribe, however, I cannot unsubsribe: The error message says

 

"The email address listed below, was not found in our newsletter database, or has already been removed from our newletter subscription list.

 

[email protected]?osCsid=5ba9fb542325807cbc03b73d3c82650e"

 

Note the session cookie

 

Can somebody help? Thanks

/e

Link to comment
Share on other sites

This would be a great contrib - but the Mysql has words in French - so when you import it to your database and then look in the admin - it is partly in French. Is there a way to change those?

 

INSERT INTO `subscribers_update` VALUES (1, 'Mise ? Jour de la table des Abonn?s', 'Compare la table des Membres enregistr?s sur le site et la table des anonymes ayant souscrit ? la newsletter.', 'newsletter', '2002-11-27 15:13:25', '2002-11-27 15:13:25', 1, 1, 'update', 1);

INSERT INTO `subscribers_update` VALUES (2, 'Mise ? Jour des Noms et Pr?noms', 'Mettre ? jour l\'ensemble des donn?es concernant le nom et le pr?nom modifi?s par les Membes Enregistr?s', '', '2002-11-29 14:42:20', '2002-11-29 14:42:20', 1, 1, 'update', 2);

INSERT INTO `subscribers_default` VALUES (1, 'Module newsletter_subscribers', '<DIV>Votre ent?te de page</DIV>', '2002-11-28 09:31:06', 1, 0, 'A tout moment vous disposez d\'un droit d\'acc?s, de modification, de rectification et de suppression des donn?es qui vous concernent (art 34 de la loi Informatique et Libert?s du 6 Janvier 1978). Vous pouvez vous d?sinscrire de la newsletter en cliquant sur le lien suivant :', 'ou vous pouvez nous contacter via notre mail : <A href="mailto:[email protected]">[email protected]</A>');

INSERT INTO `subscribers_default` VALUES (2, 'Module newsletter', '<DIV>Votre ent?te de page</DIV>', '2005-01-04 03:51:20', 1, 0, '<DIV>Pour vous d?sabonner ? la newsletter, veuillez cliquer sur le lien suivant :</DIV>', '<DIV>Cordialement, toute l\'?quipe de www.maboutique.com</DIV>');

INSERT INTO `subscribers_default` VALUES (3, 'Module product_notification', '<DIV>Votre ent?te de page</DIV>', '2005-01-04 03:53:10', 1, 0, '<DIV>Pour vous d?sabonner ? la notification des produits, veuillez vous connecter sur le site</DIV>', '<DIV> en utilsant votre login </DIV>');

 

Is there anyone who can translate that for english?

 

Also when downloading .51 version - you get version .50 instead.

Link to comment
Share on other sites

Also, when I subscribe through newsletters.php it gets only the last name and not the first. when I looked into the SQL DB, in the Type column there is "varchar(40)" on both subscribers_firstname and subscribers_lastname. - Shouldn't it be different?

Link to comment
Share on other sites

When I tried to chang the alert language from Frach to English, I found out that catalog/newsletters.php is referring to catalog/includes/boxes/newsletter.php as the souce for the script.

but actually it should be for the left column, and that is way it didn't write the first name, Gender etc' in the DB...

what is the function that tells catalog/newsletters.php to refer catalog/includes/boxes/newsletter.php ?

Link to comment
Share on other sites

Hello all, just installed latest version v048 and now have a following question and comment:

 

1. comment - there is 'firstname' missing in mysql in newsletter_subscripe.php

 

2. question: I have no problems to subscribe, however, I cannot unsubsribe: The error message says

 

"The email address listed below, was not found in our newsletter database, or has already been removed from our newletter subscription list.

 

[email protected]?osCsid=5ba9fb542325807cbc03b73d3c82650e"

 

Note the session cookie

 

Can somebody help? Thanks

 

I am not a php guy and believe it when I say I have been trying to install this newsletter manager for 2 weeks now. I did finally succeed in doing everything and just as I was playing unsubscribing I encountered exactly the same problem as listed earlier.

I am determined to try finding out what the cause is of this problem but if anybody knows the answer please let us know.

 

Thanks!

Link to comment
Share on other sites

hello efish

here are the code that will you get the first name in the newsletter.

just copy the codes and replaced with this one in your catalog/ newsletter_subscribe.php file

i hope this help.

 

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSLETTERS);

 

$subscribers_info = tep_db_query("select subscribers_id from " . TABLE_SUBSCRIBERS . " where subscribers_email_address = '" . $HTTP_POST_VARS['Email'] . "' ");

$date_now = date('Ymd');

 

if (!tep_db_num_rows($subscribers_info)) {

$gender = '' ;

tep_db_query("insert into " . TABLE_SUBSCRIBERS . " (subscribers_email_address, subscribers_firstname, subscribers_lastname, subscribers_city, subscribers_state, subscribers_zip, subscribers_country_id, language, birthdate, subscribers_gender, subscribers_email_type, date_account_created, customers_newsletter, subscribers_blacklist, ip_address, hardiness_zone, interest1, interest2, interest3, interest4, interest5, status_sent1, source_import) values ('" . strtolower($HTTP_POST_VARS['Email']) . "', '" . ucwords(strtolower($HTTP_POST_VARS['firstname'])) . "', '" . ucwords(strtolower($HTTP_POST_VARS['lastname'])) . "', '" . ucwords(strtolower($HTTP_POST_VARS['city'])) . "', '" . $state . "', '" . $HTTP_POST_VARS['zip'] . "' , '" . $HTTP_POST_VARS['country'] . "', 'English', '01/01/1900', '" . $HTTP_POST_VARS['gender'] . "' , '" . $HTTP_POST_VARS['email_type'] . "', now() , '1','0', '" . $IP . "', '" . $domain4 . "', '1', '1', '1', '1', '1', '1', 'subscribe_newsletter')");

} else {

tep_db_query("update " . TABLE_SUBSCRIBERS . " set subscribers_firstname = '" . ucwords(strtolower($HTTP_POST_VARS['firstname'])) . "', subscribers_lastname = '" . ucwords(strtolower($HTTP_POST_VARS['lastname'])) . "', subscribers_email_type = '" . $HTTP_POST_VARS['email_type'] . "', subscribers_city = '" . $HTTP_POST_VARS['city'] . "' where subscribers_email_address = '" . $HTTP_POST_VARS['Email'] . "' ");

}

 

if ($email_type == "HTMLXX") {

// build the message content

$newsletter_id='3';

$newsletter_query = "select p.newsletter_info_subject, p.newsletter_info_logo, p.newsletter_info_title, p.newsletter_info_greetings, p.newsletter_info_intro, p.newsletter_info_promo1_name, p.newsletter_info_promo1_des, p.newsletter_info_promo1_img, p.newsletter_info_promo1_url, p.newsletter_info_promo1_link, p.newsletter_info_promo2_name, p.newsletter_info_promo2_des, p.newsletter_info_promo2_img, p.newsletter_info_promo2_url, p.newsletter_info_promo2_link, p.newsletter_info_final_para, p.newsletter_info_closing, q.newsletter_email_address, q.newsletter_template, q.newsletter_user, q.newsletter_site_name, q.newsletter_site_url, q.newsletter_phone, q.newsletter_mailing_address, q.newsletter_template from newsletter_info p , newsletter q where p.newsletter_id = '" . $newsletter_id . "' and q.newsletter_id = p.newsletter_id ";

$newsletter = tep_db_query($newsletter_query);

$newsletter_values = tep_db_fetch_array($newsletter);

$gender = $HTTP_POST_VARS['gender'];

if ($gender == 'F') {

$email_greet1 = EMAIL_GREET_MS;

} else {

$email_greet1 = EMAIL_GREET_MR;

}

$customers_email_address = $HTTP_POST_VARS['Email'] ;

$from = 'STORE <[email protected]>' ;

$subject = $newsletter_values['newsletter_info_subject'] ;

$firstname = $HTTP_POST_VARS['firstname'];

$lastname = $HTTP_POST_VARS['lastname'];

$name = $HTTP_POST_VARS['firstname'] . " " . $HTTP_POST_VARS['lastname'];

$store_owner = '';

$store_owner_email = '';

$domain4 = trim($domain4);

$email_address = strtolower($HTTP_POST_VARS['Email']);

$gender = $gender;

$email_text .= BLOCK1 . $newsletter_values['newsletter_info_title'] . BLOCK2 . $newsletter_values['newsletter_info_promo1_name'] . BLOCK3 . $newsletter_values['newsletter_info_promo1_url'] . BLOCK4 . $newsletter_values['newsletter_info_promo1_img'] . BLOCK5 . $newsletter_values['newsletter_info_promo1_des'] . BLOCK6 . $newsletter_values['newsletter_info_promo1_url'] . BLOCK7 . $newsletter_values['newsletter_info_promo1_link'] . BLOCK8 . BLOCK9 . $email_greet1 . $firstname . ' ' . $lastname . ', ' . $newsletter_values['newsletter_info_greetings'] . '<br>' . BLOCK10 . '<br>' . $newsletter_values['newsletter_info_intro'] . BLOCK11 . BLOCK12 . BLOCK13 . BLOCK14 . BLOCK15 . BLOCK16 . BLOCK17 . $newsletter_values['newsletter_info_final_para'] . BLOCK18 . $newsletter_values['newsletter_info_closing'] . BLOCK19 . BLOCK20 . $email_address . BLOCK22 . BLOCK23 . 'email=' . $email_address . '&action=view' . BLOCK23A . BLOCK24 . 'email=' . $email_address . '&action=view' . BLOCK24A . BLOCK25 ;

tep_mail1($name, $email_address, $subject, $email_text, $store_owner, $store_owner_email, '');

 

} else {

 

$message .= EMAIL_WELCOME . EMAIL_WELCOME1 . CLOSING_BLOCK1 . $HTTP_POST_VARS['Email'] . CLOSING_BLOCK2 . $HTTP_POST_VARS['Email'] . CLOSING_BLOCK3 . $HTTP_POST_VARS['Email'] . CLOSING_BLOCK4 ;

mail(strtolower($HTTP_POST_VARS['Email']), EMAIL_WELCOME_SUBJECT, $message, "From: " . EMAIL_FROM);

}

 

if ($HTTP_POST_VARS['origin']) {

 

if (@$HTTP_POST_VARS['connection'] == 'SSL') {

$connection_type = 'SSL';

} else {

$connection_type = 'NONSSL';

}

tep_redirect(tep_href_link($HTTP_POST_VARS['origin'], '', $connection_type));

 

} else {

 

tep_redirect(tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBE_SUCCESS, '', 'NONSSL'));

}

 

?>

Edited by pjsingh
Link to comment
Share on other sites

hello,

 

You have a new Newsletter contribution, V0.5x.

becarefull, the code is upgraded.


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

THank you pjsingh!

 

Unfortunately, I get the following error:

 

1054 - Unknown column 'subscribers_city' in 'field list'

 

insert into subscribers (subscribers_email_address, subscribers_firstname, subscribers_lastname, subscribers_city, subscribers_state, subscribers_zip, subscribers_country_id, language, birthdate, subscribers_gender, subscribers_email_type, date_account_created, customers_newsletter, subscribers_blacklist, ip_address, hardiness_zone, interest1, interest2, interest3, interest4, interest5, status_sent1, source_import) values ('[email protected]', '', '', '', '', '' , '', 'English', '01/01/1900', 'm' , 'TEXT', now() , '1','0', '', '', '1', '1', '1', '1', '1', '1', 'subscribe_newsletter')

 

[TEP STOP]

 

 

Also, is it possible to translate the sql file to english?

Link to comment
Share on other sites

THank you pjsingh!

 

Unfortunately, I get the following error:

 

1054 - Unknown column 'subscribers_city' in 'field list'

 

insert into subscribers (subscribers_email_address, subscribers_firstname, subscribers_lastname, subscribers_city, subscribers_state, subscribers_zip, subscribers_country_id, language, birthdate, subscribers_gender, subscribers_email_type, date_account_created, customers_newsletter, subscribers_blacklist, ip_address, hardiness_zone, interest1, interest2, interest3, interest4, interest5, status_sent1, source_import) values ('[email protected]', '', '', '', '', '' , '', 'English', '01/01/1900', 'm' , 'TEXT', now() , '1','0', '', '', '1', '1', '1', '1', '1', '1', 'subscribe_newsletter')

 

[TEP STOP]

Also, is it possible to translate the sql file to english?

 

 

i am So Sorry

i forgot i change the database on my end. once i am done with all the changes to newsletters i will post the contribution.

yes the database will be in english.

Link to comment
Share on other sites

Dont worry i found my own answer out!!

Module = Newsletter goes to all customers who have newsletter boxed ticked in their accounts.

module = newsletter_subscribers goes to all those who have just used the sign up box to subscribe, it will also send the newsletter to all customers if you have updated the tables.

Link to comment
Share on other sites

I do have another further question.

 

When previewing the email, no unsubscribe link comes so I cant see if this is working or not.

 

What im wondering is if I send a newsletter to

module Newsletter, does this contain a unsubscribe link or a link to the account page?

 

Or do all newsletters just automatically add a unsubscribe link back to the frontpage unsubscribe page?

 

Help much appreciated guys.

Link to comment
Share on other sites

Hello all, just installed latest version v048 and now have a following question and comment:

 

1. comment - there is 'firstname' missing in mysql in newsletter_subscripe.php

 

2. question: I have no problems to subscribe, however, I cannot unsubsribe: The error message says

 

"The email address listed below, was not found in our newsletter database, or has already been removed from our newletter subscription list.

 

[email protected]?osCsid=5ba9fb542325807cbc03b73d3c82650e"

 

Note the session cookie

 

Can somebody help? Thanks

 

I am stuck on this matter for almost 2 weeks now.

Any suggestion to what is mentionned above would be greatly appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

I have exactly the same problem.

Could Gyakutsuki have a lok at it ?

 

L'adresse Email ci-dessous, n'a pas ?t? trouv?e dans base de donn?es des newsletter, ou elle a ?t? d?j? supprim?e de notre liste.

 

[email protected]?osCsid=8d25e3f3fa1b0083aabeedc9e1b47d06

Thanks

Patrice

 

I am stuck on this matter for almost 2 weeks now.

Any suggestion to what is mentionned above would be greatly appreciated.

Edited by patator
Link to comment
Share on other sites

Hi.

 

I need to use my own submitbutton and not the default one, how can I change it to use one of my own buttons ? The code is this:

 

'text' ?=> ?'<form name="newsletter" action="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBE, '', 'NONSSL') . '" method="post" onSubmit="return verify(this);">' . TEXT_NAME . '<br><input type="text" name="lastname" value="" checked size="15" maxlength="35"><br><br>' . TEXT_EMAIL . '<br><input type="text" name="Email" value="" checked size="15" maxlength="35">' . '<input type="submit" name="Submit" value="ok">' . '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, '', 'NONSSL') . '"></form>');

Edited by Yari
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...