This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Subscribe User to MailChimp | |
*/ | |
function wooms_mailchimp_subscribe_user($order_id,$posted){ | |
if(!empty($_POST['wooms_susbscribe']) && $_POST['wooms_susbscribe'] == '1'){ | |
try{ | |
$email = $posted['billing_email']; | |
$merge_vars = array('FNAME' => $posted['billing_first_name'],'LNAME' => $posted['billing_last_name']); | |
$api = new MCAPI(mailchimp_api_key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//add action to process mailchimp signup if checked | |
function mc_checkout_field_process() { | |
//only run the following if the option to subscribe has been selected | |
if ( $_POST['mc-subscribe'] == 'on' ) { | |
//retrieve email, first, and last name from form | |
$email = $_POST['billing_email']; | |
$first_name = $_POST['billing_first_name']; | |
$last_name = $_POST['billing_last_name']; |