Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter & Subscribtion for MS2


Gyakutsuki

Recommended Posts

I will post the code snippet in my admin/mail.php:

 

// MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Email when WYSIWYG Disabled)

    if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Disable') {

    $mimemessage->add_text($message);

    } else {

    $mimemessage->add_html($message);

    }

// MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Email when WYSIWYG Enabled)

 

    $mimemessage->build_message();

    while ($mail = tep_db_fetch_array($mail_query)) {

      $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);

    }

and this is in admin/mails.php

 

// MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Email when WYSIWYG Disabled)

 

    if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Disable') {

 

    $mimemessage->add_text($message);

 

    } else {

 

    $mimemessage->add_html_newsletter($message);

 

    }

 

Have you already installed the Admin Wysiweg Html Area Controller?

 

 

In my admin/mail.php and admin/mails.php that snipp of code doesn't exist.

 

No i dont i have installed the Admin Wysiweg Html Area Controller.

Link to comment
Share on other sites

  • Replies 336
  • Created
  • Last Reply

Top Posters In This Topic

In my admin/mail.php and admin/mails.php that snipp of code doesn't exist.

 

No i dont i have installed the Admin Wysiweg Html Area Controller.

 

 

I would recommend you to backup your files and do that. Have a look at my previous posts. There you will find the link to the contribution.

 

I think this specific module was concepted for a site with the WYSIWEG Controller.

Link to comment
Share on other sites

Sorry for my absence. I don't receive a mail in this post, i don't know why.

 

This contribution work only with html code.

 

You find in admin../functions directory, the files mail.php and a function called add_html_newsletter

 

/**
* Adds a html part to the mail.
* Also replaces image names with
* content-id's.
*/
// #################### Changed Newsletter & Subscriber ?#################""
? ?function add_html_newsletter($html, $text = NULL, $images_dir = NULL) {

? ? ? ?$this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), ' ',$html);
// ? ? ?$this->html = ?$html;
// #################### End Changed Newsletter & Subscriber ?#################""

? ? ?$this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

? ? ?if (isset($images_dir)) $this->find_html_images($images_dir);
? ?}
// #################### End Changed Newsletter & Subscriber ?#################""

? ?function add_html($html, $text = NULL, $images_dir = NULL) {

// #################### Changed Newsletter & Subscriber ?#################""
? ? ?$this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
// ? ? ? ?$this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), ' ',$html);
// #################### End Changed Newsletter & Subscriber ?#################""

? ? ?$this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

? ? ?if (isset($images_dir)) $this->find_html_images($images_dir);

 

i created this new function, because when you send an sheet, you have a <br> every lines but all the newsletter is in html.

This function delete the <br>.

 

if you want to comeback with the last function you change in newsletter module or unsubscriber newsletter this function

add_html_newsletter by add_html.

 

That's all.

 

note : you have the site the 4.2 or 4.3 version

Edited by Gyakutsuki


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

Hello again,

 

In the last version of your contribusion: newsletter_subscribers_v044

 

In the install file it stand that application_top.php file should be edited, but the file that named application_top.php_ADD doesn't follow your zipped contribusion + the others adds files.

 

Is this the same files as in the first version of this contribusion or is it some more changes to them?

 

regards

Thomas

Link to comment
Share on other sites

You can download v0.44. Just a little update.

 

I would say that this newsletter is different that original, and simplify, some options for the users are deleted and optimised. Indeed, a customers want stay an anonymous and don't want to insert this address .... I think today the difference between the anonymous and the members are importants, and you can have now marketing strategy.

 

If you use this contribution on your local computer you can have an error email when you sent a newsletter. If you use on your provider, you haven't problem. I don't know why.

 

--------

 

There, an import email module in cvs (excel) :

 

This is module is in devlopment and i have just little pb. For an expert, it's simply to resolve this pb.

 

This module must realised :

If the email does'nt exist in base, it's inserted (ok)

If the email exist in database, it's updated (not ok).

 

I don't know if my code is perfect, but you can upload a new mail now, but if you want update a mail, it' doesn't work, he is added.

 

Coul you help me to solve this problem .

 

Thanks.

 

installation :

In admin, create a file called newsletters_import.php

In admin/includes/finames.php => define('FILENAME_NEWSLETTERS_IMPORT','newsletters_import.php');

In the boxe add : // '<a href="' . tep_href_link(FILENAME_NEWSLETTERS_IMPORT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_NEWSLETTER_IMPORT. '</a>');

 

<?php
/*
 $Id: newsletters.php,v 1.17 2003/06/29 22:50:52 Gyakutsuki Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');


// on v?rifie l'adresse e-mail
function EmailOK($subscribers_email_address)
{
 return( ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
              '@'.
              '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
              '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',
              $subscribers_email_address) );
}
switch($action)
{
 /* LECTURE ET AJOUT DES DONNEES DANS LA TABLE */
  case "ajouter":
 
/* On ouvre le fichier ? importer en lecture seulement */
if (file_exists($fichier))
    $fp = fopen("$fichier", "r"); 
else
/* le fichier n'existe pas */
    { 
      echo "Fichier introuvable !<br>Importation stopp?e.";
      exit();
    }

//  on importe       
   while (!feof($fp)) 
   { 
// Tant qu'on n'atteint pas la fin du fichier 
      $ligne = fgets($fp,4096); // On lit une ligne   

// On r?cup?re les champs s?par?s par; dans liste
      $liste = explode( ";",$ligne);  
  
// On assigne les variables 

      $subscribers_lastname  = $liste[0]; 
      $subscribers_firstname  = $liste[1]; 
      $subscribers_email_address = $liste[2]; 
      $customers_newsletter  = $liste[3]; 
      $subscribers_blacklist  = $liste[4]; 

// Changement des valeurs afin de pouvoir contacter ces personnes via la newsletter ou le mail des anonymes 
if ($customers_newsletter=='')
  {
   $customers_newsletter = '1';
  }
if ($subscribers_blacklist=='')
  {
   $subscribers_blacklist = '0';
  }	

// V?rification du formatage de l'email
if(EmailOK($subscribers_email_address))
{
 $requete="select subscribers_id, subscribers_email_address from " . TABLE_SUBSCRIBERS . " where email='$subscribers_email_address'";

//elle n'existe pas, on l'ins?re
 if($subscribers_email_address == 0)
 {
  $query = "INSERT INTO " . TABLE_SUBSCRIBERS . " (subscribers_lastname, subscribers_firstname, subscribers_email_address, customers_newsletter, subscribers_blacklist)
     VALUES ('".$subscribers_lastname."','".$subscribers_firstname."','".$subscribers_email_address."','".$customers_newsletter."','".$subscribers_blacklist."')  ";
       $result= MYSQL_QUERY($query);
  } else  {
// elle existe, on la met ? jour
       echo htmlentities("Cet enregistrement existe d?j?, il a ?t? mis ? jour" );
      $query = " UPDATE  " . TABLE_SUBSCRIBERS . " (subscribers_lastname,       subscribers_firstname,       subscribers_email_address,       customers_newsletter,       subscribers_blacklist)
                                   VALUES ('".$subscribers_lastname."','".$subscribers_firstname."','".$subscribers_email_address."','".$customers_newsletter."','".$subscribers_blacklist."') where subscribers_email_address = '" . subscribers_email_address . "')";
      $result= MYSQL_QUERY($query); 
   }
}


     if(mysql_error())
       { /* Erreur dans la base de donnees, s?rement la table qu'il faut cr?er */
          print "Erreur dans la base de donn?es : ".mysql_error();
          print "<br>Importation stopp?e.";
          exit();
       } 
/* Tout va bien */
      else 
        print "$subscribers_email_address / $subscribers_lastname <br>";
    } 
    echo "<br>Importation termin?e, avec succ?s. <br> Les adresses email imcompl?tes n\'ont pas ?t? import?es."; 
    /* Fermeture */ 
    fclose($fp); 
  break;

/* FORMULAIRE DE CHOIX D'IMPORTATION */  
  default: 
?>  
<?php // echo "<form method=\"post\" action=\"$PHP_SELF\">"; ?>
 <?php echo "<form action=\"$PHP_SELF\" method=\"post\" enctype=\"multipart/form-data\">";?> 
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  
    Pour ajouter ton serveur il suffit de remplir ce formulaire 
    <table border="0" cellspacing="0" cellpadding="3" align="center">
     <tr>
     <tr>
      <td>Fichier :</td> 
      <td> <input type="file" name="fichier"> </td> 
     </tr>
 <tr>
       <td></td>  
      <td> <input type="submit" name="submit" value="Ajouter"> </td> 
     </tr>
    </table>
    <input type="hidden" name="action" value="ajouter">  
   </form>
</table>
<?php break;   
  }
?>

</body> 
</html>


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

i've installed the contrib today

and have a big problem when i wanna send a newsletter to subscribers

 

Warning: reset(): Passed variable is not an array or object in /home/moshpit/www.moshpit.at/catalog/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/moshpit/www.moshpit.at/catalog/admin/includes/classes/object_info.php on line 18

Warning: main(includes/languages/german/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 330

Warning: main(includes/languages/german/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 330

Warning: main(): Failed opening 'includes/languages/german/modules/newsletters/.php' for inclusion (include_path='.:/usr/share/php') in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 330

Warning: main(includes/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 331

Warning: main(includes/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 331

Warning: main(): Failed opening 'includes/modules/newsletters/.php' for inclusion (include_path='.:/usr/share/php') in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 331

Fatal error: Cannot instantiate non-existent class: in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 335

 

it's clear that he can't find the file.

because something is wrong

Link to comment
Share on other sites

i've installed the contrib today

and have a big problem when i wanna send a newsletter to subscribers

 

Warning: reset(): Passed variable is not an array or object in /home/moshpit/www.moshpit.at/catalog/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/moshpit/www.moshpit.at/catalog/admin/includes/classes/object_info.php on line 18

Warning: main(includes/languages/german/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 330

Warning: main(includes/languages/german/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 330

Warning: main(): Failed opening 'includes/languages/german/modules/newsletters/.php' for inclusion (include_path='.:/usr/share/php') in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 330

Warning: main(includes/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 331

Warning: main(includes/modules/newsletters/.php): failed to open stream: No such file or directory in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 331

Warning: main(): Failed opening 'includes/modules/newsletters/.php' for inclusion (include_path='.:/usr/share/php') in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 331

Fatal error: Cannot instantiate non-existent class: in /home/moshpit/www.moshpit.at/catalog/admin/newsletters_subscribers.php on line 335

 

it's clear that he can't find the file.

because something is wrong

 

After messing with this contrib for far too long I just said screw it and installed an outside package. I'm using DadaMail. It's free and nice!

Example: http://purelyalpaca.com/cgi-bin/dada/mail.cgi

 

:D

Link to comment
Share on other sites

When I try and subscribe and put info into the BOX on the website.. I get the following error

 

Parse error: parse error, unexpected '.' in /home/website/public_html/site/catalog/includes/languages/english/newsletters.php on line 21

 

I dont understand why :( its stressing me out to the fullest I dont know how to install nor I have time. :@

Link to comment
Share on other sites

hi!

 

please correct me if i'm wrong .. here is something missing

install.txt

Admin side

----------

 

1. copy files in the admin subdirectories

 

2. you need to add some lines in the files :

 

admin/includes/application _top.php

admin/includes

 

what lines should i add into application_top.php, and when i try to subscribe on frontpage i receive blank page .. but first thing first .. what lines :blink:

Link to comment
Share on other sites

hi!

 

please correct me if i'm wrong .. here is something missing

install.txt

what lines should i add into application_top.php, and when i try to subscribe on frontpage i receive blank page .. but first thing first .. what lines  :blink:

 

 

let me post just few more lines ... at the moment i'm little pis... beacuse i'm doing 4th clean install of this contribution and i don't get it to work, which i'd love cause i have thousands of subsrcibers which are not our customers now ... probably they won't be, but we inform them always, as they requested.

 

my test page is at www.vstopnice.com at the bottom on the right you will see newsletter box ...

 

if i try to subscribe i receive blank page .. also in admin if i put

 

  require(DIR_WS_BOXES . 'newsletters.php');

 

i get only displayed left column without Newsletter link, and if i enter

 

  if (tep_admin_check_boxes('newsletters.php') == true) {

    require(DIR_WS_BOXES . 'newsletters.php');

 

i receive blank page with header only ...

 

as i wrote .. 4th install and still not working .. please we are starting next week with grandopening and this thing is the only that can stop our plans ..

 

thank you very much in advance

 

Gregor

Link to comment
Share on other sites

I have such problem. :'(

 

This module uses standard osCommerce or STS or the other variants templates?

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Link to comment
Share on other sites

hi!

 

please correct me if i'm wrong .. here is something missing

install.txt

what lines should i add into application_top.php, and when i try to subscribe on frontpage i receive blank page .. but first thing first .. what lines  :blink:

 

 

The CLUE to this is in the Install TXT:

 

All modification in osc original are between

########### Added #############"

and

########### End Added ############

 

You need to see the database_table.php and filenames.php for

CATALOG and ADMIN

 

For CATALOG:

 

 

// ############### Added ######################

// define the database table names used in the newsletters project

 

define('TABLE_SUBSCRIBERS', 'subscribers');

 

and filenames .php

 

// ############## Added #############

// define the file names used in the newsletters project

define('FILENAME_NEWSLETTERS', 'newsletters.php') ;

define('FILENAME_NEWSLETTERS_SUBSCRIBE', 'newsletters_subscribe.php') ;

define('FILENAME_NEWSLETTERS_SUBSCRIBE_SUCCESS', 'newsletters_subscribe_success.php') ;

define('FILENAME_NEWSLETTERS_UNSUBSCRIBE' ,'newsletters_unsubscribe.php');

define('FILENAME_NEWSLETTERS_UNSUBSCRIBE_DONE' ,'newsletters_unsubscribe_done.php');

 

 

// unsubsribe

define('FILENAME_UNSUBSCRIBE' ,'unsubscribe.php');

define('FILENAME_UNSUBSCRIBE_DONE' ,'unsubscribe_done.php');

 

// ########### End Added ##############

 

 

+++++++++++++++++++++++++++++++++++++

It did work copying these to the application_top.php

for me for the ADMIN but for CATALOG I get problems with the

application_top.php, which doesn't load and outputs a blank page.

 

I get the same problem with column_left.php as well.

 

Wonder if copying from the french files to english files cause it

though I am using php editor ( HAPEDIT)

Link to comment
Share on other sites

i don't get it .. you mean you entered quote for filenames.php into application_top.php ??

 

how can this work?

 

where is author of this contribution?

 

Yes, That is right if you are using version MS1 where you have

only one file (application_top.php). Otherwise put them in the two files

seperately.

 

Also for your previous question about column_left.php

please see the code correction on page No1 of this thread.

Link to comment
Share on other sites

Line 21, delete ); or ');. The correction is in v0.45

 

Regards

 

 

Hello Loic,

 

I am trying to get this working on a MS1 installation

 

So far I have the Admin and Catalog part working where a

member can sign up and is added to SUBSCRIBERS list with

E mail confirmation, deletionetc.

 

I have two problems

 

The Mail is not sent out on the NEWSLETTER or from the

Sendmail link in the admin.

 

I don't see any error message in the SERVER so can't figure out

what is not parsing.

 

Previously the send mail did work with HTML as I have the WYSIWYG

mod.

 

Could you please suggest what could be the problem ?

 

Many thanks in advance.

Link to comment
Share on other sites

Yes, That is right if you are using version MS1 where you have

only one file (application_top.php). Otherwise put them in the two files

seperately.

 

Also for your previous question about column_left.php

please see the code correction on page No1 of this thread.

 

hmm .. i'll try that but i'mnot sure this will work on MS2 .. i'll post the results

Link to comment
Share on other sites

hmm .. i'll try that but i'mnot sure this will work on MS2 .. i'll post the results

 

 

I get this error message (on trying again)

 

PHP Fatal error: Call to undefined function: tep_convert_linefeeds() in /home/affili43/affili43-www/catalog/admin/includes/classes/email.php on line 159

Link to comment
Share on other sites

Hello Loic,

 

I am trying to get this working on a MS1 installation

 

So far I have the Admin and Catalog part working where a

member can sign up and is added to SUBSCRIBERS list with

E mail confirmation, deletionetc.

 

I have two problems

 

The Mail is not sent out on the NEWSLETTER or from the

Sendmail link in the admin.

 

I don't see any error message in the SERVER so can't figure out

what is not parsing.

 

Previously the send mail did work with HTML as I have the WYSIWYG

mod.

 

Could you please suggest what could be the problem ?

 

Many thanks in advance.

 

I am getting this error messge now

 

PHP Fatal error: Call to undefined function: tep_convert_linefeeds() in /home/affili43/affili43-www/catalog/admin/includes/classes/email.php on line 159

Link to comment
Share on other sites

Yes, That is right if you are using version MS1 where you have

only one file (application_top.php). Otherwise put them in the two files

seperately.

 

Also for your previous question about column_left.php

please see the code correction on page No1 of this thread.

 

ok .. when i corrected links form page no.1 in admin everything is working now .. but column left on main page i still receive blank page when i try to submit an email and name to subscribe ...

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...