[Plugin: Contact Form 7] Checkbox results in email? (6 posts)

  1. quadrinary
    Posted 6 years ago #

    How do i get the results of checkboxes to show up in the final email sent to my address with the user's contact info?



  2. stvwlf
    Posted 6 years ago #

    Hi - see this page on the plugin FAQ

    The important part is the code for the checkbox has to go in the right side of the form, in the lower section, as part of the message body box

    Also be aware you will only be told of the boxes that are checked, not the ones that are not checked.

  3. quadrinary
    Posted 6 years ago #

    Yes, i'm putting all my code in there. Everything works as planned except for the check boxes.

    In my contact form i'm defining my checkboxes by:
    [checkbox* PreferContactby: "E-mail" "Post"]

    I've tried these variations in the email portion:
    [PreferContactby: "E-mail" "Post"]

    It just ends up displayed in my email as "[PreferContactby]"

  4. Takayuki Miyoshi
    Posted 6 years ago #

    [checkbox* PreferContactby: "E-mail" "Post"]

    it should be
    [checkbox* PreferContactby "E-mail" "Post"]

    colon is not necessary.

  5. stvwlf
    Posted 6 years ago #


    I just tested this. In the plugin's form area I added it two ways

    <p>[checkbox* PreferContactby: "E-mail" "Post"]</p>
    <p>[checkbox* PreferContact "E-mail" "Post"]</p>

    In the Mail area I added them like this:

    <p>Prefer Contact By [PreferContactby:]</p>
    <p>Prefer Contact By [PreferContact]</p>

    (The text after <p> displays a message before the checkbox output in the email, so its clear which field is displaying.)

    Both of those methods worked correctly when I received the email.

  6. Takayuki Miyoshi
    Posted 6 years ago #

    @stvwlf you're right. It works. I meant that you should use [checkbox* PreferContactby "E-mail" "Post"] in form if you use [PreferContactby] in mail. So, you should use [checkbox* PreferContactby: "E-mail" "Post"] when you use [PreferContactby:] in mail. The important point is to use the same name in form and mail.

Topic Closed

This topic has been closed to new replies.

About this Topic