Html Email and Conditional Fields

Creative Contact Form is a responsive jQuery contact form with amazing visual effects. You will be surprised by count of all the possible features!
Tue Nov 26, 2019 1:37 am

  • By default CCF uses table structure to style Html emails.

    If you need to create a custom style of Html email, you can delete default structure in Email Template field(CCF->Forms->Your Form->Email Template), and use custom styling.

    You can access the field label by using
    [FIELD_LABEL:FIELD_ID]
    structure.
    And to get field value, use
    [FIELD_VALUE:FIELD_ID]
    structure.
    Where FIELD_ID is the ID of desired field. You can get the list of IDs from Fields page(CCF->Fields).

    But when using conditional logic, it will cause misbehaviour when the condition is false, and the field is hidden.

    For example, you have list of fields, where the item with ID 77 is conditional field(is visible depend on some logic ).

    Email Template:
    Code: Select all
    ...
    [FIELD_LABEL:10]: [FIELD_VALUE:10],
    [FIELD_LABEL:77]: [FIELD_VALUE:77],
    ...


    So to show the field block with ID-77 ONLY when condition is true, you can use the following structure:
    [IF_EXISTS_ID:ID]
    code here
    [ENDIF]


    And the Email Template will looks like:
    Code: Select all
    ...
    [FIELD_LABEL:10]: [FIELD_VALUE:10],
    [IF_EXISTS_ID:77]
    [FIELD_LABEL:77]: [FIELD_VALUE:77],
    [ENDIF]
    ...
    Best Regards,

    Simon
    User avatar
    Simon
    Site Admin
     
    Posts: 1620
    Joined: Wed Mar 05, 2014 1:04 am


Return to Creative Contact Form




Information
  • Who is online
  • Users browsing this forum: No registered users and 9 guests
cron