Skip to content

Instantly share code, notes, and snippets.

@mkeplinger
Created March 30, 2012 00:22
Show Gist options
  • Save mkeplinger/2245219 to your computer and use it in GitHub Desktop.
Save mkeplinger/2245219 to your computer and use it in GitHub Desktop.
function merge_participant_to_sendpepper($id) {
$detail = $this -> get_participant_detail($id);
$email = $detail['email'];
$options['fname'] = $detail['fname'];
$options['lname'] = $detail['lname'];
$options['address'] = $detail['address'];
$options['address2'] = $detail['address2'];
$options['city'] = $detail['city'];
$options['state'] = $detail['state'];
$options['zipcode'] = $detail['zipcode'];
$options['ax_custom']['ref_share_url'] = $detail['ref_share_url'];
$options['ax_custom']['ref_view_url'] = $detail['ref_view_url'];
$product = $detail['product'];
$product_detail = $this->CI->product->get_product_detail($product);
if(isset($product_detail['sendpepper']['request_date_key'])){
$options['ax_samples'][$product_detail['sendpepper']['request_date_key']] = date("m-d-y");
$options['ax_samples']['Last Sampled Product'] = $product_detail['sendpepper']['lsp'];
$options['ax_samples']['Last Sampled Product Handle'] = $product_detail['sendpepper']['lsph'];
$options['ax_samples']['Shipping Address Update URL'] = $detail['address_change_url'];
$options['ax_samples']['Special Purchase Offer Code'] = md5(date('m-d', strtotime('+'.$this->CI->config->item("hash_code_number_of_days").' days')));
}
$options['ax_seq_tag']['remove_sequence_id'] = $product_detail['sendpepper']['seq_rid'];
$options['ax_seq_tag']['add_sequence_id'] = $product_detail['sendpepper']['seq_id'];
$options['ax_seq_tag']['add_tag_id'] = $product_detail['sendpepper']['tag_id'];
$options['ax_seq_tag']['remove_tag_id'] = $product_detail['sendpepper']['tag_rid'];
$options['ax_seq_tag']['tag_id'] = $product_detail['sendpepper']['tag_id'];
$data = $this->update_send_pepper($email,$options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment