WordPress.org

Ready to get started?Download WordPress

Forums

CF7 AutoResponder Addon
Opt-in Box (14 posts)

  1. shawnwyatt
    Member
    Posted 1 year ago #

    Would it be possible to add a CF7 checkbox that would allow the user to click and sign up at that time rather than have MailChimp email them? Something like a "Join our Newsletter, click here:" I'm concerned that the user is getting a separate email from MailChimp, that's all. Neat plugin!

    http://wordpress.org/extend/plugins/contact-form-7-autoresponder-addon-plugin/

  2. Japander
    Member
    Posted 1 year ago #

    I would like to have that checkbox-feature too ;)

  3. wpsolutions
    Member
    Plugin Author

    Posted 1 year ago #

    Yes I agree that would be a good feature.
    I will add this functionality in the next release due within a few weeks. Stay tuned.

  4. plumwd
    Member
    Posted 1 year ago #

    If you want to update the code so that it requires a checkbox do the following:

    In your form, add a checkbox, something like:

    Subscribe to our Newsletter <input type="checkbox" id="subscribe" name="subscribe" value="yes"/>

    Then in cf7_autoresponder_addon.php edit the following:

    After this line (129):

    $email = $cf7->posted_data["your-email"]; //get the submitted email address from CF7

    add:

    $check_sub = $cf7->posted_data["subscribe"]; //get the checkbox from the form

    Then find the following section:

    $api = new MCAPI($mc_api);
    $yourlists = $api->lists();
    
    foreach ($yourlists['data'] as $list){
      if($list['name'] == $mc_list)
      {
        $retval = $api->listSubscribe( $list['id'], $email, $mergeVars);
        //add subscriber to mailchimp
      }
    }

    Replace it with the following:

    if ($check_sub == “yes”) {
    $api = new MCAPI($mc_api);
    $yourlists = $api->lists();
    
    foreach ($yourlists['data'] as $list){
      if($list['name'] == $mc_list)
      {
        $retval = $api->listSubscribe( $list['id'], $email, $mergeVars);
        //add subscriber to mailchimp
      }
    }
    }
  5. wpsolutions
    Member
    Plugin Author

    Posted 1 year ago #

    You could do what plumwd suggested (thanks for that) or wait till next week when I release the new version of this plugin.

  6. Japander
    Member
    Posted 1 year ago #

    Great, really thanks :)
    You don't know how much work you put off my shoulders ;o)

  7. plumwd
    Member
    Posted 1 year ago #

    @wpsolutions I hope I didn't step on any toes! I just had a client waiting on the solution and couldn't wait. Looking forward to the update!

  8. wpsolutions
    Member
    Plugin Author

    Posted 1 year ago #

    @plumwd - no not at all and that's what I would've done too :)

  9. wpsolutions
    Member
    Plugin Author

    Posted 1 year ago #

    Hi guys,
    I've just released a new version.
    The new version now has the functionality which gives the visitor the option to allow subscription to a mail-list via a checkbox.
    Note, the plugin requires that you set the "name" parameter of the checkbox to "mc-subscribe".

    Also note that the existing functionality still applies if you don't have a checkbox - ie, the plugin will automatically try to add your visitors to your list if you have enabled the settings.

    thanks,
    peter

  10. shawnwyatt
    Member
    Posted 1 year ago #

    Awesome!!

  11. Japander
    Member
    Posted 1 year ago #

    Hey wpsolutions,

    i have a few suggestions for your addon ;o)

    1. Would it be possible to customize the name of the fields, maybe on the settingspage, so one can choose "in my form, the first name is called "my_personal_form_1_first_name"". (I'm from germany, i choosed german words ;) )

    2. can you move the settings directly to the cf7 options, so its listed in the admin sidebar under cf7, not general settings (dunno the exact english translation), think this would make more sense :) Since i dont know how, i just can tell you that "Contact Form to DB Extension" and "Contact-Form-7: 3rd-Party Integration" were already doing that :)

    And a have a question,
    can one use just the checkbox, or does the acceptance box works, too?

    Best regards,
    Marko

  12. wpsolutions
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Marko,
    Thanks for the suggestions and yes I agree that both of the suggestions are good :)
    I always take note of the feedback given and if I feel a suggestion is popular enough I will make every effort to put it in.
    Mostly, it all depends on how much time I have whether I can put all suggestions in.

    Regarding your question about the acceptance box - yes this will work too as long as you name it as per the requirements.

  13. Trionic Labs
    Member
    Posted 1 year ago #

    Fantastic plugin and the mc-subscribe option is a great addition, but it wasn't working for me because the field was always coming back even when the box was unchecked (which meant it subscribed no matter if the box was checked or not).

    The following tweak resolved it for me:


    $mc_subscribe_value = isset($cf7->posted_data["mc-subscribe"]) ? $cf7->posted_data["mc-subscribe"] : '';

    if (($optin_box_exists) && $mc_subscribe_value == '')

  14. wpsolutions
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the heads up Blogrescue.
    I have since fixed the bug and released the fix in version 1.2.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic