Forums / General Questions / How to send Newsletter to groups of customers

How to send Newsletter to groups of customers

Views: 1,012

Results 1 to 4 of 4
1 Sep 2015, 1:03 PM
#1
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

How to send Newsletter to groups of customers

I like the Newsletter function in Zen Cart.

Is there ant way that I can create my own groups of customers to send email?

7 Sep 2015, 7:53 PM
#2
jwlamb avatar

jwlamb

Zen Follower

Join Date:
Jan 2014
Location:
Arizona
Posts:
110
Plugin Contributions:
0

Re: How to send Newsletter to groups of customers

No, the only people that get the newsletter is those that sign up for it.

7 Sep 2015, 11:33 PM
#3
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: How to send Newsletter to groups of customers

jodean:

I like the Newsletter function in Zen Cart.

Is there ant way that I can create my own groups of customers to send email?

Take a look in includes/functions/audience.php

8 Sep 2015, 12:56 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to send Newsletter to groups of customers

I didn't make note of from where in the forum I created the following, but here are two queries that can be created to address particular distribution lists for use in newsletters or other emails:

INSERT INTO query_builder (`query_category`, `query_name`, `query_description`, `query_string`, `query_keys_list`) VALUES ('email,newsletters', 'All customers who have NOT purchased product #196', 'All customers who have NEVER purchased product #196, ignoring newsletter-subscription status.', 'SELECT c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c WHERE c.customers_id NOT IN (SELECT c.customers_id FROM TABLE_CUSTOMERS c, TABLE_ORDERS o, TABLE_ORDERS_PRODUCTS op WHERE c.customers_id=o.customers_id AND o.orders_id=op.orders_id AND op.products_id=196) GROUP BY c.customers_email_address ORDER BY c.customers_lastname, c.customers_firstname ASC', ''); 

The above query (starting with SELECT in the middle of the INSERT INTO statement) returns the email address of all people that did not order the product number identified (196) in this case.

INSERT INTO query_builder (`query_category`, `query_name`, `query_description`, `query_string`, `query_keys_list`) VALUES ('email,newsletters', 'All customers who have purchased product #103', 'All customers who have ever purchased product #103, ignoring newsletter-subscription status.', 'select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o, TABLE_ORDERS_PRODUCTS op WHERE c.customers_id = o.customers_id AND o.customers_id = c.customers_id AND o.orders_id = op.orders_id AND op.products_id = 103 GROUP BY c.customers_email_address ORDER by c.customers_lastname, c.customers_firstname ASC', '');

The above query can be run to add an email distribution list to select a list of people that have ordered from the website by product number. This was first used to add Item #37 by changing all cases of 103 to 37. Additional queries will be added to these notes as they become known.

I do see that in this second query there are back quotes used in the first set of parentheses. These may need to be changed to single quotes...

I haven't used the code in a long while but had captured it from the forum around July of 2013... Hopefully there is enough information provided to create the distribution list desired... Remember to honor your customers requests of notification/not being notified...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...