MailPoet subscriptions selections through checkboxes

Home Forums Quform WordPress MailPoet subscriptions selections through checkboxes

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13206
    Joe Dostie
    Participant

    Hello,

    I have read several help articles including:
    http://support.mailpoet.com/knowledgebase/plugin-form-integrate/

    MailPoet

    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!)

    #13209
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #13210
    Joe Dostie
    Participant

    Ally you ROCK!!!!

    This was it, it works perfect now!

    Thank you so much!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy