• Resolved christopherheaven

    (@christopherheaven)


    I want to include an option/checkbox to sign-up for a Mailchimp mailing list when submitting a WCP Contact Form. However, if I add the integration code from Mailchimp for WordPress above or below the short code for WCP Contact Form on a page it doesn’t get parsed. Can you please direct me to the proper file from WCP Contact Form to insert the following code so it appears above the send button and below the other options so it gets executed on submission?

    <p>
    <label>
    <input type=”checkbox” name=”mc4wp-subscribe” value=”1″ />
    Sign me up for your mailing list!
    </label>
    </p>

    Also, if you could add the ability to add short code on the form page it would make this much easier in the future. Ideally I would like to just add a checkbox with a short code value of [mc4wp-subscribe] instead of editing a plugin file each time you update WCP Contact Form.

    Thanks.
    Chris

    https://wordpress.org/plugins/wcp-contact-form/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WebCodin

    (@webcodin)

    Chris,

    You can try to do following steps:

    1) Add to your active theme template “scfp.php” as described in the FAQ section:

    How can I change the form content?
    The plugin includes some templates in “templates/” folder. You can copy any template in your active theme and customize it for your needs. Path to the templates folder inside the active theme:
    [ActiveTheme]/templates/wcp-contact-form/

    2) Add following shortcode do_shortcode('[mc4wp-subscribe]'); or use your code in necessary place of this template.

    Please let us know if this will help.

    with best regards,
    WordPress WebCodin Team.

    Thread Starter christopherheaven

    (@christopherheaven)

    Thank you sir. That worked perfect.

    For future reference for anybody else who wants to do this here are the precise steps:

    In the admin panel install the MailChimp for WP plugin, set it up with your API etc., navigate to the Integrations option, edit the custom option, select your mailing list, set the other options the way you want them and save your changes.

    After that ssh in to your server and do the following:

    cd [wordpress directory]/wp-content/themes/[active theme]/

    mkdir templates (if this directory doesn’t exist already)

    cd templates

    mkdir wcp-contact-form

    cd wcp-contact-form

    cp [wordpress directory]/wp-content/plugins/wcp-contact-form/templates/scfp.php . (don’t miss the trailing dot for current working directory)

    vi scfp.php

    Add this code:

    <p>
    <label>
    <input type=”checkbox” name=”mc4wp-subscribe” value=”1″ checked=”checked” />
    Sign me up for your mailing list!
    </label>
    </p>

    Just above:
    <div class=”scfp-form-action scfp-form-button-position-<?php echo $button_position;?>”>

    Save the file, refresh the contact form page and send a test message.

    Cheers,
    Chris

    Very useful thank you. But a little confusing for anyone that doesn’t know ssh.

    In my case, just edit the scfp.php as you show above.

    Plugins>wcp-contact-form>templates

    Works great for me. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mailchimp Integration’ is closed to new replies.