Jump to content
Sign in to follow this  
Gyakutsuki

Newsletter & Subscribtion for MS2

Recommended Posts

If anyone is having trouble with the welcome email, privacy policy and unsubscribe links. the following information will fix it.

 

In catalog/includes/lanquages/english/newsletter.php find this line:

 

 

define('CLOSING_BLOCK3', "\n\n" . 'View our privacy policy at: ' . HTTP_SERVER . DIR_WS_CATALOG . 'privacy.php' . '.');

 

Change to:

 

define('CLOSING_BLOCK3', 'View our privacy policy at: ' . HTTP_SERVER . DIR_WS_CATALOG . 'privacy.php' . '.');

 

 

Hope this helps

 

Actually that didn't solve the problem for me, it just removed line returns and the links were still corrupted. To fix the problem open catalog/newsletters_subscribe.php and find this line:

 

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

 

And change to:

 

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

Share this post


Link to post
Share on other sites

on contribution page we go from 0.53 to 0.55 : Newsletter & Subscribers v055 chibibotoons90 26 Feb 2009

 

it would be nice to know the cahnges since Newsletter & Subscribers v055\admin\newsletters.php

ahs a lot of changes in comparaison of the previous one

 

 

v0.54 Update by:Draksic D. (ddSHADOW)

 

v0.53 & v.053a Update by: Keith W. (HomeWetBar)

 

V0.52 Updated by loîc Richard alias Gyakutsuki

 

V0.50 - V0.51 Update by Rondeau Olivier (webmaster@delaballe.com)

date 22-01-2005

 

good to write by who , but would be fair to see what has been updated :blink:

so we can make the contrib evovle in a proper way


MS2

Share this post


Link to post
Share on other sites

i also wrote to the contributor of Correction to last Spanish addition upload techgoddess 15 Jun 2009

 

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.

 

 

because for a "FULL" package the files toldabout are not in the zip

 

would be good for new version to update the installation.txt so that we could know how to update by given the details of the code change or to change


MS2

Share this post


Link to post
Share on other sites
i also wrote to the contributor of Correction to last Spanish addition upload techgoddess 15 Jun 2009

 

2nd

Replace from

$confirm_string = // all the table

Till

return $confirm_string;

}

 

do we really have to remove : return $confirm_string;


MS2

Share this post


Link to post
Share on other sites
Sorry.

Could you post any screenshot about this installed contribution?

Thank you.

 

Is this call for altering files a mistake in the installation guide ?

includes/languages/english/english.php

Share this post


Link to post
Share on other sites
Is this call for altering files a mistake in the installation guide ?

I think I got it almost done ... :rolleyes: great Newsletter contribution.

 

A few little hick-ups I got...

  1. double ups (options appear with and without "1.")
  2. wide headings (makes the admin area to expand to the right too far)
  3. no admin control

 

To the latter ... I don't seem to have the admin control as mentioned in the contribution introduction ...

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)

 

(for the first two, please have a look at the collage attached herto)

NL.01.gif

Everything else worked out just fine. (I had but to add the "newsletter _table" manually since the provided SQL-file didn't create it during the sql-query).

 

Thanks a lot for your help

Share this post


Link to post
Share on other sites
Cause Admin_level_acces

 

In admin/includes/column-left.php

 

Replace

 �if (tep_admin_check_boxes('newsletters.php') == true) {
� �require(DIR_WS_BOXES . 'newsletters.php'); �
�}

by

� �  require(DIR_WS_BOXES . 'newsletters.php');

 

After in admin/includes/boxes/newsletters.php

Replace

// � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_ADMIN . '</a><br>' .
// � � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_EXTRA_DEFAULT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_EXTRA_DEFAULT . '</a><br>' .
// � � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_EXTRA_INFOS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_EXTRA_INFOS . '</a><br>' .
// � � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_UPDATE, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_UPDATE . '</a><br>' .
// � � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_SUBSCRIBERS_VIEW . '</a>' � � � � � � � � �

� � � � �
� �tep_admin_files_boxes(FILENAME_NEWSLETTERS_SUBSCRIBERS, BOX_NEWSLETTER_ADMIN) .
� � � � � � � � � � � �tep_admin_files_boxes(FILENAME_NEWSLETTERS, BOX_CUSTOMERS_NEWSLETTER_MANAGER) .

� �tep_admin_files_boxes(FILENAME_NEWSLETTERS_EXTRA_DEFAULT, BOX_NEWSLETTER_EXTRA_DEFAULT). � � � � � � � � � � � � � � � � �
� �tep_admin_files_boxes(FILENAME_NEWSLETTERS_EXTRA_INFOS, BOX_NEWSLETTER_EXTRA_INFOS) .
� �tep_admin_files_boxes(FILENAME_NEWSLETTERS_UPDATE, BOX_NEWSLETTER_UPDATE) �. � � � � 
� �tep_admin_files_boxes(FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW, BOX_NEWSLETTER_SUBSCRIBERS_VIEW) 
);
//Admin end
�}

by

 � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_ADMIN . '</a><br>' .
� � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_EXTRA_DEFAULT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_EXTRA_DEFAULT . '</a><br>' .
� � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_EXTRA_INFOS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_EXTRA_INFOS . '</a><br>' .
� � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_UPDATE, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_UPDATE . '</a><br>' .
� � � � � � � � � � � � � � � � � '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_SUBSCRIBERS_VIEW . '</a>'); � � � � � � � � �
�}

 

This support thread seems to be as dead as my dog ... (it dies 12 years ago) ;-)

 

Anyway ... since I never get any answer here I just spent some time to go through every line of the code and discovered some hick-ups. I changed this and now I got it finally working (although I must say there are some features in this contribution that I don't understand why they are there at all to start with ... nothing I can do with it except reading a ONE LINE with irrelevant stuff and then press the BACK BUTTON.

 

After having it installed to WORK - I am not 100% sure yet if this is a worthwhile thing to go through anyway.

 

So, anyone having trouble getting it going, you may want to look into the INSTALLATION file and notice/do the following:

find instructions for:

l)admin/includes/modules/newsletters/newsletters.php

and

m)admin/includes/modules/newsletters/product_notification.php ...

... at the very end of those long code you are suppose to replace ... there is a '}' ... this will most likely cause you trouble if you don't omit it!

 

In addition:

The install version will ask you to "ALTER" admin/newsletters.php ... WELL

if you have some other contributions installed and made some changes to this file, tough life ... it will all be lost because this contribution also a NEW FILE, the very same "admin/newsletters.php" which you are asked to upload as a new file >>> hence, having gone through trouble and did the new alteration on your existing file it will all be overridden by the new file!

 

My suggestion ... DELETE the admin/newsletters.php from the part that includes ALL NEW FILES and just alter your existing admin/newsletters.php.

 

ONE LAST ... if you ever get an error saying that the headers are sent already, did you? Then check the mentioned files for 'white spaces" especially at the end and after ?> This should fix it.

 

I did all this on MY SIDE and ever since got rid of all the errors and the contribution is installed successfully. Still need to figure out if it's worth all the trouble.

 

Cheers

Share this post


Link to post
Share on other sites
Parse error is normally caused by a missing tag such as ' " ; } when you copied the code you likely missed something.

 

Dear all, I am very new and know little about PHP program. I understand that the problem that I've is about missing curly bracket etc. However I really don't know where is the problem start as below:

 

I received this Parse error: parse error message when I'm sending newsletter.

 

Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/xxxxxx/public_html/admin/includes/modules/newsletters/newsletter.php on line 121

 

and this is the lines

 

// ################# Contribution Newsletter v050 ##############
function send($newsletter_id) {
  $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

  while ($mail = tep_db_fetch_array($mail_query)) {
  $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
  // Préparation de l'envoie du mail en HTML 
  $mimemessage->add_html_newsletter($this->header . "\n\n" . $this->content . "\n\n" . $this->unsubscribea . " " . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">'  . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>' . "\n\n" . $this->unsubscribeb);

	$mimemessage->build_message();
// ################# END - Contribution Newsletter v050 ##############
  echo $mail['customers_newsletter_email'] . "<br>";
  $mimemessage->send('', $mail['customers_newsletter_mail'], '', 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 is no start for the curly bracket and I hope all master out there can help me solve this problem. Your immediate help in this matter is highly appreciated.

 

Best regards.

 

:(

Share this post


Link to post
Share on other sites

 

Dear all, I am very new and know little about PHP program. I understand that the problem that I've is about missing curly bracket etc. However I really don't know where is the problem start as below:

 

I received this Parse error: parse error message when I'm sending newsletter.

 

Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/xxxxxx/public_html/admin/includes/modules/newsletters/newsletter.php on line 121

 

and this is the lines

 

// ################# Contribution Newsletter v050 ##############
function send($newsletter_id) {
  $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

  while ($mail = tep_db_fetch_array($mail_query)) {
  $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
  // Préparation de l'envoie du mail en HTML 
  $mimemessage->add_html_newsletter($this->header . "\n\n" . $this->content . "\n\n" . $this->unsubscribea . " " . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">'  . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>' . "\n\n" . $this->unsubscribeb);

	$mimemessage->build_message();
// ################# END - Contribution Newsletter v050 ##############
  echo $mail['customers_newsletter_email'] . "<br>";
  $mimemessage->send('', $mail['customers_newsletter_mail'], '', 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 is no start for the curly bracket and I hope all master out there can help me solve this problem. Your immediate help in this matter is highly appreciated.

 

Best regards.

 

:(

 

BUMP for help

Share this post


Link to post
Share on other sites
Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/xxxxxx/public_html/admin/includes/modules/newsletters/newsletter.php on line 121

 

out of the 27 lines, which one is line 121?

Share this post


Link to post
Share on other sites

You have mismatched curly braces.

 

Try changing the last three lines:

 

	}
 }
?>

to

 

  }
?>


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites
You have mismatched curly braces.

 

Try changing the last three lines:

 

	}
 }
?>

to

 

  }
?>

 

Hi Jim,

 

Thanks for the support. I'll edit and see how it goes.

 

Cheers.

Share this post


Link to post
Share on other sites

I have just installed the newsletter add on that lets you sign up for a newsletter without creating an account. All the tables are showing fine in the admin panel, but when i click send to send the newsletter, I receive the following error:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/csperli1/public_html/airflowresearch.com/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/csperli1/public_html/airflowresearch.com/admin/includes/classes/object_info.php on line 18

Fatal error: Class name must be a valid object or a string in /home/csperli1/public_html/airflowresearch.com/admin/newsletters.php on line 311

 

In my customers.php file I have already made the array() change, so i'm not sure why the object_info.php error message is popping up either. I did import the customers from my old database and that is the only reason i'm thinking it may not be working properly, but that still doesn't explain the class name error.

Edited by burtonsnow8

Share this post


Link to post
Share on other sites

SQL ?

 

There seem to be no sql subscription check in this current version as I can subscribe ... unlimited times! Any suggestions on that?

Share this post


Link to post
Share on other sites

version as of 14 Aug 2009

 

in installation.txt

 

file: admin/includes/modules/newsletters/newsletters.php

 

operation: 3rd Replace

 

The new code uses the query:

 

$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

 

but shouldn't the query be more like this:

 

$mail_query = tep_db_query("select subscribers_firstname as customers_firstname, subscribers_lastname as customers_lastname, subscribers_email_address as customers_email_address from " . TABLE_SUBSCRIBERS . " where customers_newsletter = '1'");

 

This edit is working on my store so I am happy. Thanks to all for the contribution, but I really have spent my allotted "2-4" hours on an otherwise 1 hour job. I'm not uploading the above code but if the next developer on the trail could check this out that would be fantastic for future users.

 

Jules_Text (no reply)

Share this post


Link to post
Share on other sites

Dear all,

 

I'm new with this contribution, is anyone here help me how to send a newsletter using this contribution ? I have searched all the topic, but I still confused... please help...

 

btw, in the installation file, I read that a several new files included and in the CATALOG listed below:

CATALOG:

newsletters.php

newsletters_subscribe.php

newsletters_subscribe_success.php

newsletters_unsubscribe.php

newsletters_unsubscribe_done.php

unsubscribe.php

unsubscribe_done.php

includes/boxes/newsletters.php

includes/languages/english/newsletters.php

includes/languages/english/newsletters_unsubscribe.php

includes/languages/english/unsubscribe.php

includes/languages/english/images/buttons/button_unsubscribe.gif

the problem is... I cann't find the newsletters.php at the first listed above, where is the file exactly?

 

thanks

Share this post


Link to post
Share on other sites
Dear all,

 

I'm new with this contribution, is anyone here help me how to send a newsletter using this contribution ? I have searched all the topic, but I still confused... please help...

 

btw, in the installation file, I read that a several new files included and in the CATALOG listed below:

 

the problem is... I cann't find the newsletters.php at the first listed above, where is the file exactly?

 

thanks

 

is there anyone can help me with my problem here??

 

I really confused with this contribution, I already installed it and this is my screenshot in admin modul:

2aeqkl.jpg

 

how to use this newsletter ??

 

help me please....

Share this post


Link to post
Share on other sites
version as of 14 Aug 2009

 

in installation.txt

 

file: admin/includes/modules/newsletters/newsletters.php

 

operation: 3rd Replace

 

The new code uses the query:

 

$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

 

but shouldn't the query be more like this:

 

$mail_query = tep_db_query("select subscribers_firstname as customers_firstname, subscribers_lastname as customers_lastname, subscribers_email_address as customers_email_address from " . TABLE_SUBSCRIBERS . " where customers_newsletter = '1'");

 

This edit is working on my store so I am happy. Thanks to all for the contribution, but I really have spent my allotted "2-4" hours on an otherwise 1 hour job. I'm not uploading the above code but if the next developer on the trail could check this out that would be fantastic for future users.

 

Jules_Text (no reply)

 

Ignore above post.

Share this post


Link to post
Share on other sites

how to change the style of that go button?

I put code look like this one in stylesheet, not work.

 

.buttonSubmit {

color: white;

background-color: #660;

font-size: 1.5em;

border: 1px solid #660;

padding: 4px;

}

Share this post


Link to post
Share on other sites

I got this error on all the modules page..

 

Module used to send the newsletter:	   Module product_notification
Page Header: 	
Fatal error: Call to undefined function tep_draw_textarea_field() in /home/janlevin/public_html/shop/admin/newsletters_extra_default.php on line 141

Share this post


Link to post
Share on other sites

Hi,

 

The contrib works great cept for 1 snafu.

when user clicks on unsubscribe link in their newsletter email, is taken to:

https://****.com/~MYdomain/unsubscribe.php?email=emailTOunsubscribe@hotmail.com

fine so far..

however when the unsubscribe button is clicked the url now reads:

http://www.MYdomain.com/unsubscribe_done.p...ribehotmail.com

Note that the @ is missing from the email address at the end of the URL

this causes the email address not to be found in the customers table

if i add the @ to the URL the person is unsubscribed

the code in catalog/unsubscribe.php that seems to be the culprit is:

$email_to_unsubscribe=$_GET['email']; (i modified the original which was $HTTP_GET_VARS- now deprecated)

does anyone know why the @ is missing from the email address?

thank you for your insight

Note to newbies and people not experienced with PHP coding:

You can see from the pages and pages of this topic, that there are so many bugs and problems with the front end of the contribution it's probably not worth using it. I've taken out ALL the unsubscribe functionality on my site: it's too risky to use vs. manual methods via an email link. The backend is wonky, but useable. It's a real shame, because technically, the newsletter list idea is not very complicated.


OSC User Definitions

"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.

"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why

"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×