Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Luca Pacucci 1 post 21 karma points
    Mar 16, 2022 @ 12:16
    Luca Pacucci

    Handler dependant on input values

    I would like to send an email confirmation to the user after he submit the form. But also I want to know if it's possibile to choose which email handler to use dependant on a checkbox value of the form.

    So if the users checks the optional field, they will recive the email of type 'A'. Otherwise they will receive an email of type 'B'

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Mar 17, 2022 @ 20:48
    Nicholas Westby

    The simplest way I can think of to implement this would be to create multiple fields so that one is associated with each handler. You would then dynamically populate these fields based on the checkbox chosen (if it's just the one checkbox, then that'd just be two fields).

    You can then configure each handler to use either of those fields as the dynamic recipients field.

    The challenge would be to handle the situation where the other handler doesn't send an email. That might cause an error, or Formulate might just ignore it and not send the email. You'll have to experiment with that. If it doesn't ignore it and causes an error, then one option would be to create a dummy email address (e.g., [email protected]) that gets all the emails you don't care about.

    So HandlerA is configured to send to DynamicEmailsA and HandlerB is configured to send to DynamicEmailsB. Then populate DynamicEmailsA and DynamicEmailsB based on whether or not Checkbox1 is selected.

    There is a server side event you can use to perform this check and dynamically populate the field values. Here are some details about that:

Please Sign in or register to post replies

Write your reply to: