How to wrap Mailchimp API in conditional statement

Home Forums Quform WordPress How to wrap Mailchimp API in conditional statement

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

    I followed the documentation for integrating mailchimp via their API and it worked like a charm. My issue is that I would like to add the mail list opt-in to the end of an unrelated survey form on my site. If I add the code supplied in the documentation here to my functions.php file, it will add every respondent to the survey to my mailchimp list regardless of their answer to that final question. (I understand that is provided for the case of a simple sign up form.)

    The final question says something along the lines of “Would you like to receive our newsletter via email?”

    My question is probably simple. How do I wrap the sample code provided in the documentation to only run the post process mytheme_save_to_mailchimp function when the user selects “yes”?

    Again, the question is presently set up as a multiple choice radio button with the only two options being “Yes” and “No”. The unique ID is iphorm_1_57

    P.S.: This may be something to consider adding to your documentation as it seems to be a pretty common use case. I’m not complaining, though. Simply my two cents.

    #3087
    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.

    #3093
    jgibsat
    Participant

    Works perfectly. Thanks!

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