Zen Cart Logo
Forums / General Questions / Modify email newsletter signup - reroute to Mail Chimp

Modify email newsletter signup - reroute to Mail Chimp

Views: 784

Results 1 to 6 of 6
28 Oct 2013, 8:47 PM
#1
jgold723 avatar

jgold723

Zen Follower

Join Date:
Dec 2010
Posts:
362
Plugin Contributions:
0

Modify email newsletter signup - reroute to Mail Chimp

We're setting up a Mail Chimp account to handle our email newsletter. To that end, we want emails gathered on the new account and user account pages to be directed to Mail Chimp and not to the ZC database.

I can figure out the Mail Chimp API, but I'm stumped as to how I get the customer's email address from the account page. Right now it looks like ZC just sends a zenid to the database:

<form name="account_newsletter" action="https://quinceandco.com/store/index.php?main_page=account_newsletters&zenid=ccf906e9ecfcb26b4591fec4e64e26f0" method="post"><input type="hidden" name="action" value="process" />

Is there a different variable that I can use that will contain the email address and not a zenid?

29 Oct 2013, 10:42 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,699
Plugin Contributions:
56

Re: Modify email newsletter signup - reroute to Mail Chimp

If you use my Mailchimp Integration contribution, this problem is already solved. Click the Plugins link at the top of the page and search for MailChimp.

29 Oct 2013, 12:55 PM
#4
jgold723 avatar

jgold723

Zen Follower

Join Date:
Dec 2010
Posts:
362
Plugin Contributions:
0

Re: Modify email newsletter signup - reroute to Mail Chimp

Thanks -- I'll check that out. I did find a mailchimp plugin, but it was for a sidebox and we don't use those. I'm assuming the one you refer to works with the newsletter signup on the account page?

31 Oct 2013, 12:44 PM
#5
jgold723 avatar

jgold723

Zen Follower

Join Date:
Dec 2010
Posts:
362
Plugin Contributions:
0

Re: Modify email newsletter signup - reroute to Mail Chimp

Hi SW Guy -- I installed your plugin, but it only seems to work as a sidebox (which we don't use in our layout). I was able to insert the sidebox code directly onto the account_newsletter template, but it still requires that the user enter their email address manually.

Is it possible to grab the users email address and have that pre-fill the form field?

1 Nov 2013, 12:33 AM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,699
Plugin Contributions:
56

Re: Modify email newsletter signup - reroute to Mail Chimp

Sure. Assuming the customer is logged in you want something like this:

    if($_SESSION['customer_id']) {
      $sql = "SELECT customers_email_address  
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = :customersID";

      $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
      $check_customer = $db->Execute($sql);
      $customer_email= $check_customer->fields['customers_email_address'];
  ... then you can fill in your field with $customer_email