Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Transfer Cs-Cart Registered User Email To Subscriber List Rate Topic   - - - - -

 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 02 August 2016 - 03:41 PM #1

I am using CS-CART V 4.3.7 and I want to add the email id's of all currently registered customers to the subscribers list in bulk and henceforth upon new registration customer's email should directly go into subscriber list

 

Please help me how to do this.



 
  • KBM
  • Senior Member
  • Members
  • Join Date: 08-Dec 08
  • 252 posts

Posted 03 August 2016 - 04:57 AM #2

When a customer is good enough to register on your website or to make a purchase I would hesitate to automatically enroll them as a subscriber. 


Version 4.3.9

 


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 03 August 2016 - 05:47 AM #3

When a customer is good enough to register on your website or to make a purchase I would hesitate to automatically enroll them as a subscriber. 

I still want thr email in subscriber list so that we can send them weekly newsletter of our latest products and promotion.



 

Posted 03 August 2016 - 05:54 AM #4

I still want thr email in subscriber list so that we can send them weekly newsletter of our latest products and promotion.

 

Though it is a bad practice to subscribe your customers to a newsletter without their permission you can do it via the Export/Import feature (Administration > Import data > Subscribers).


Sincerely yours, CS-Cart Support Team

 

User guide       |  Developer documentation  |  Core API documentation


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 03 August 2016 - 12:17 PM #5

I don't want this way. Its a tedious job. By default every member's email registering on my website should go into subscriber list. Please help anyone

 

Though it is a bad practice to subscribe your customers to a newsletter without their permission you can do it via the Export/Import feature (Administration > Import data > Subscribers).



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 03 August 2016 - 02:21 PM #6

app/addons/newsletters/controllers/frontend/checkout.pre.php

 

Try to replace:

      if (!empty($_REQUEST['mailing_lists']) && !fn_is_empty($_REQUEST['mailing_lists'])) {
            if (empty($subscriber)) {
                $_data = array(
                    'email' => Tygh::$app['session']['cart']['user_data']['email'],
                    'timestamp' => TIME,
                );

                $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
            } else {
                $subscriber_id = $subscriber['subscriber_id'];
            }

            fn_update_subscriptions($subscriber_id, $_REQUEST['mailing_lists'], NULL, fn_get_notification_rules(true));
        } elseif (isset($_REQUEST['mailing_lists'])) {
            if (!empty($subscriber)) {
                fn_delete_subscribers($subscriber['subscriber_id']);
            }
        }

with

            $_REQUEST['mailing_lists'] = array(1,2,3);
            if (empty($subscriber)) {
                $_data = array(
                    'email' => Tygh::$app['session']['cart']['user_data']['email'],
                    'timestamp' => TIME,
                );

                $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
            } else {
                $subscriber_id = $subscriber['subscriber_id'];
            }

            fn_update_subscriptions($subscriber_id, $_REQUEST['mailing_lists'], NULL, fn_get_notification_rules(true));

where 1,2,3 - IDs of the required mailing lists (can be found in the admin panel)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 04 August 2016 - 07:03 AM #7

Hi ecom Thanks. But I have disabled guest checkout on my website. So any customer wanting to purchase the product will have to register compulsorily. Upon registration I want them to become subscribers of newsletter automatically. Kind

 

app/addons/newsletters/controllers/frontend/checkout.pre.php

 

Try to replace:

      if (!empty($_REQUEST['mailing_lists']) && !fn_is_empty($_REQUEST['mailing_lists'])) {
            if (empty($subscriber)) {
                $_data = array(
                    'email' => Tygh::$app['session']['cart']['user_data']['email'],
                    'timestamp' => TIME,
                );

                $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
            } else {
                $subscriber_id = $subscriber['subscriber_id'];
            }

            fn_update_subscriptions($subscriber_id, $_REQUEST['mailing_lists'], NULL, fn_get_notification_rules(true));
        } elseif (isset($_REQUEST['mailing_lists'])) {
            if (!empty($subscriber)) {
                fn_delete_subscribers($subscriber['subscriber_id']);
            }
        }

with

            $_REQUEST['mailing_lists'] = array(1,2,3);
            if (empty($subscriber)) {
                $_data = array(
                    'email' => Tygh::$app['session']['cart']['user_data']['email'],
                    'timestamp' => TIME,
                );

                $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
            } else {
                $subscriber_id = $subscriber['subscriber_id'];
            }

            fn_update_subscriptions($subscriber_id, $_REQUEST['mailing_lists'], NULL, fn_get_notification_rules(true));

where 1,2,3 - IDs of the required mailing lists (can be found in the admin panel)



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 04 August 2016 - 07:25 AM #8

Hi ecom Thanks. But I have disabled guest checkout on my website. So any customer wanting to purchase the product will have to register compulsorily. Upon registration I want them to become subscribers of newsletter automatically. Kind

 

This code will do the trick. But only after first order is placed (even it will not be paid)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 04 August 2016 - 07:38 AM #9

This code will do the trick. But only after first order is placed (even it will not be paid)

Is there any way to do this immediately after registration of the customer instead of after the first order placed.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 04 August 2016 - 08:36 AM #10

app/functions/fn.users.php
 
add
     if (Registry::get('addons.newsletters.status') == 'A') {            
            $subscriber = db_get_row("SELECT * FROM ?:subscribers WHERE email = ?s", $user_data['email']);

            $mailing_lists = array(1,2,3);
            if (empty($subscriber)) {
                $_data = array(
                    'email' => $user_data['email'],
                    'timestamp' => TIME,
                );
 
                $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
            } else {
                $subscriber_id = $subscriber['subscriber_id'];
            }
 
            fn_update_subscriptions($subscriber_id, $mailing_lists, NULL, fn_get_notification_rules(true));
     }
 
after the following line:
$user_id = db_query("INSERT INTO ?:users ?e" , $user_data);
(!) Not tested

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 04 August 2016 - 09:29 AM #11

there is no different mailing lists as such.

I am using E-mail Marketing Addon by Simtech instead Newsletter addon by Simtech. Please guide accordingly as there are no mailing lists in E-mail Marketing Addon

 

Thanks ecom labs in advance.

app/functions/fn.users.php
 
add

     if (Registry::get('addons.newsletters.status') == 'A') {            
            $subscriber = db_get_row("SELECT * FROM ?:subscribers WHERE email = ?s", $user_data['email']);

            $mailing_lists = array(1,2,3);
            if (empty($subscriber)) {
                $_data = array(
                    'email' => $user_data['email'],
                    'timestamp' => TIME,
                );
 
                $subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
            } else {
                $subscriber_id = $subscriber['subscriber_id'];
            }
 
            fn_update_subscriptions($subscriber_id, $mailing_lists, NULL, fn_get_notification_rules(true));
     }
 
after the following line:
$user_id = db_query("INSERT INTO ?:users ?e" , $user_data);
(!) Not tested

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 04 August 2016 - 02:14 PM #12

Please try

if (Registry::get('addons.email_marketing.status') == 'A') {            
      fn_em_subscribe_email($user_data['email'], array(
            'name' => $user_data['firstname']
      ));
}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 09 August 2016 - 09:00 AM #13

 

Please try

if (Registry::get('addons.email_marketing.status') == 'A') {            
      fn_em_subscribe_email($user_data['email'], array(
            'name' => $user_data['firstname']
      ));
}

Hi, Thanks , I tried this. Its working. Now one small help I don't want them to receive message that they have been subscribed after registering and while placing the order.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 09 August 2016 - 10:18 AM #14

Hi, Thanks , I tried this. Its working. Now one small help I don't want them to receive message that they have been subscribed after registering and while placing the order.

app/addons/email_marketing/func.php

 

replace

fn_set_notification('I', __('email_marketing.subscription_confirmed'), $msg);

with.

//fn_set_notification('I', __('email_marketing.subscription_confirmed'), $msg);

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 19 August 2016 - 12:59 PM #15

 

app/addons/email_marketing/func.php

 

replace

fn_set_notification('I', __('email_marketing.subscription_confirmed'), $msg);

with.

//fn_set_notification('I', __('email_marketing.subscription_confirmed'), $msg);

Hi ecom,

 

Thanks on behalf of all members. You are doing a great job. I am using subscribe Popup Addon by HungryWeb. Now when Anyone subscribe from the popup should see the message, I just want people who are registering or ordering should not see that message. How can I do this??

 

I would like to donate 25$ for the free help you have been giving to us. Please share the link



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 19 August 2016 - 02:24 PM #16

 


Hi ecom,

 

Thanks on behalf of all members. You are doing a great job. I am using subscribe Popup Addon by HungryWeb. Now when Anyone subscribe from the popup should see the message, I just want people who are registering or ordering should not see that message. How can I do this??

 

I would like to donate 25$ for the free help you have been giving to us. Please share the link

 

Thank you very much. Please PM me for details. It is required to examine 3rd party module


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • cool999
  • Senior Member
  • Trial users
  • Join Date: 26-Jul 12
  • 269 posts

Posted 22 August 2016 - 05:40 AM #17

Thank you very much. Please PM me for details. It is required to examine 3rd party module

PMed you. Expecting a quick revert back. Thanks.