Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

newsletters_subscribers_manager_1.4.4_1_1 on 2.3.4 osc


wendyv

Recommended Posts

I have multiple customers who subscribed to our newsletter. I can find this in my databasetable customers. I have 22 people where whitin the column "customer_newsletter" the value is set to 1, a few others have 0 as value.

When i check table newsletter_subscription is see only 17 subscribers (a few of them are manualy added in by me because of this error).

 

I would like to know how i get get the subscribers into the tabel newsletter_subscription.

Can anyone help me fix this problem?

Txs!

 

This is my newsletter subscription.php

<?php
/*
  $Id: newsletter_subscription.php 25 May 2015

  Based on http://addons.oscommerce.com/info/8472

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

  Copyright (c) 2012 osCommerce

  Released under the GNU General Public License
*/

   require('includes/application_top.php');
   require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSLETTER_SUBSCRIPTION);

  $email_subscription = tep_db_prepare_input(strtolower(str_replace("'", "", $_POST['emailsubscription'])));

  $inscrits_check_query = tep_db_query("select count(*) as checkinscrits from " . TABLE_NEWSLETTER_SUBSCRIPTION . " where subscription_addresse_email = '" . $email_subscription . "' ");
  $inscrits_check_values = tep_db_fetch_array($inscrits_check_query);

  if ( ($inscrits_check_values['checkinscrits']=='0') && ($email_subscription != '') ) {
    $sql_data_array = array('subscription_addresse_email' => $email_subscription,
                            'subscription_date_creation' => 'now()',
                            'subscription_newsletter' => '1');
    tep_db_perform(TABLE_NEWSLETTER_SUBSCRIPTION, $sql_data_array);
    $insert_id = tep_db_insert_id();

    $email_unsubscribe = str_replace('@', '4r0b6s3', $email_subscription);

    $message = EMAIL_START_HTML;
    $message .= EMAIL_SPAN_START_STYLE;
    $message .= EMAIL_WELCOME . TEXT_PRIVACY_EMAIL . sprintf(NL_UNSUBSCRIBE_LINK, 'emailunsubscribe=' . $email_unsubscribe . '&iID='. $insert_id, 'emailunsubscribe=' . $email_unsubscribe . '&iID='. $insert_id);
    $message .= EMAIL_SPAN_STOP_STYLE;
    $message .= EMAIL_STOP_HTML;
   tep_mail('', $email_subscription, EMAIL_WELCOME_SUBJECT, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// recevoir un mail d'une nouvelle inscription
    if (PREVENIR_EMAIL_NEW_INSCRIT_NL == 'oui') {
     tep_mail('', STORE_OWNER_EMAIL_ADDRESS, EMAIL_NEW_INSCRIT_NL, $email_subscription, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    }
   }

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

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