• Resolved presser1

    (@presser1)


    Hi,

    I’m trying to get it so that only fields that are filled out in the contact form are then sent to email to display all data entered from that form.

    The issue I’m having is even when hidden items are not entered on the contact form, they are still being displayed in the email message. I think one of the reasons this is happening is that options are being auto-populated within the form (e.g. on a pull-down menu, it isn’t blank to start off, so therefore it’s technically something that’s been enterered) and therefore it’s showing up in the email content.

    I have also checked “Exclude lines with blank mail-tags from output.”

    Thank you

    • This topic was modified 3 years, 9 months ago by presser1.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Hey, you can use groups in your email message as well. Just make sure to wrap the relevant fields with the correct group tags. This will make sure that only fields that were visible during form submission will be included in the email message. https://conditional-fields-cf7.bdwm.be/docs/faq/can-i-use-conditional-logic-in-the-email-message/

    Thread Starter presser1

    (@presser1)

    Appreciate the quick reply. I am sure this simple, but I am not sure I’m totally grasping it yet. Here’s an similar example of a question on the contact form that ends up in the email, even though it wasn’t answered in the contact form:

    [group group-964]
    Date Flexibility: [select* menu-401 “Only on this date” “Within 1 day” “Within 2 days” “Within 3 days” “Flexible on date”]
    [/group]

    In the “Mail” section I have “[menu-401]” but I don’t have the “[group-964]” I tried putting in the groups and it wasn’t populating correctly on the email.

    Plugin Author Jules Colle

    (@jules-colle)

    Put this in your email message:

    [group-964]
    Date Flexibility: [menu-401]
    [/group-964]

    You can also play around with this in the form-tester if you’d like https://conditional-fields-cf7.bdwm.be/form-tester/

    • This reply was modified 3 years, 9 months ago by Jules Colle.
    Thread Starter presser1

    (@presser1)

    Let me see if that works….

    Thread Starter presser1

    (@presser1)

    Changing the group programming to your previous (edited) message causeD the logic to stop working.. I need to figure out how to put that back the way it was.

    Plugin Author Jules Colle

    (@jules-colle)

    Here’s another example: https://conditional-fields-cf7.bdwm.be/form-tester/?test-form=Conditional+email+message+%281%29

    The logic is pretty simple, but my examples might be a bit too confusing. Sorry for that.

    Thread Starter presser1

    (@presser1)

    I see what happened – I need to fill out conditional fields again…everything got reset..

    • This reply was modified 3 years, 9 months ago by presser1.
    Plugin Author Jules Colle

    (@jules-colle)

    no… i think you are overthinking it

    Thread Starter presser1

    (@presser1)

    Likely. I’m going to read everything you sent and see if I can figure it out. Thank you.

    Thread Starter presser1

    (@presser1)

    Ok, so with your example (thank you) I was able to get it to exclude anything not filled out on the form. Appreciate it.

    A couple questions, if you don’t mind. It’s not directly related to your logic plugin, but is there a way to get rid of spaces when I get the email? In other words, areas where I put the group within the email, there’s extra spaces between lines in what I receive in the email. Example:

    Line 1
    Line 2
    (space here)<–want to get rid of the space
    (space here)<–want to get rid of the space
    Line 3

    I’m just trying to tidy up the look and format of what I receive a bit. Also, is there a way to display how dates show in emails? Right now, it’s year, month and day – trying to get month, date and year.

    It would be nice is there was 1 line of programming within the mail section to tell it that whatever was filled in the form, display in an email.

    Thanks again for your quick help.

    Plugin Author Jules Colle

    (@jules-colle)

    You could get rid of unwanted spaces by always opening a new group immediately after closing the previous one.

    So for example instead of

    [group1]
      ...
    [/group1]
    [group2]
      ...
    [/group2]
    

    Do this:

    [group1]
      ...
    [/group1][group2]
      ...
    [/group2]
    

    PS: I’ll be implementing an update in a future version to make sure that whitespaces between closing and opening groups will be stripped automatically, but for now you’ll need to rely on this approach

    Thread Starter presser1

    (@presser1)

    Thank you.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Contact form date to email’ is closed to new replies.