Home › Forums › Quform WordPress › MailPoet subscriptions selections through checkboxes
- This topic has 2 replies, 2 voices, and was last updated 9 years, 5 months ago by Joe Dostie.
- AuthorPosts
- November 27, 2014 at 5:18 am #13206Joe DostieParticipant
Hello,
I have read several help articles including:
http://support.mailpoet.com/knowledgebase/plugin-form-integrate/Passing Form values from form to form with multiple choice element
And a few others. At this point I think I’m just not getting it…
I would like my subscribers to chose different subscription options via some check boxes.
These check boxes are single entities (for display purposes only)My function currently ONLY grabs the last regardless if the other boxes are checked. I think I am almost there but I am doing something wrong (maybe need an array or something).
Here is my code:
——————————————————————————-
function my_quform_mailpoet_subscribe($form)
{
if (class_exists(‘WYSIJA’)) {
$email = $form->getValue(‘iphorm_3_1’);
$Newsletter = $form->getValue(‘iphorm_3_3’);
$Volunteering = $form->getValue(‘iphorm_3_21’);
$Fostering = $form->getValue(‘iphorm_3_22’);
$Adoption = $form->getValue(‘iphorm_3_18’);
$Sponsor = $form->getValue(‘iphorm_3_23′);if ($Sponsor=’Sponsor’){$listId = 8;}
if ($Newsletter=’News Letter’){$listId = 5;}
if ($Volunteering=’Volunteering’){$listId = 6;}
if ($Fostering=’Fostering’){$listId = 4;}
if ($Adoption=’Adoption’){$listId = 7;}$user_data = array(
’email’ => $email
);$data_subscriber = array(
‘user’ => $user_data,
‘user_list’ => array(‘list_ids’ => array($listId))
);$helper_user = WYSIJA::get(‘user’,’helper’);
$helper_user->addSubscriber($data_subscriber);
}
}
add_action(‘iphorm_post_process_3’, ‘my_quform_mailpoet_subscribe’);
——————————————————————————-I am sure its in the “IF” area, I’m just not sure how to correct it.
Any guidance would be greatly appreciated!!!!!
WebPage: http://69.195.124.253/~ctwocndo (being developed!)
November 27, 2014 at 10:32 am #13209AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 27, 2014 at 1:44 pm #13210Joe DostieParticipantAlly you ROCK!!!!
This was it, it works perfect now!
Thank you so much!
- AuthorPosts
- You must be logged in to reply to this topic.