• Resolved Sean

    (@mccues)


    The email notification form includes the {all_fields} variable by default. For our various email routing recipients, I’d like to include the email address that the form was submitted to. This field is not listed in the dropdown list of form fields. I was assuming it would be something like {email_recipient} or {user_email} or something, but I’m just taking shots in the dark and can’t find the correct code. Please advise what is the correct value for this field. Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @mccues

    I hope you’re well today!

    I’m not quite sure if I correctly understand the goal here but let me try ??

    In general, the form is not “submitted to email” but rather just “submitted” and then
    – it can be set to store submission in DB or not
    – and can have e-mail notifications created.

    At least one of above options should be set if you want to actually receive any data from the form but they don’t have to. You can as well use the form without storing any data; for example if you only want to provide fields for user that will later be used in redirect URL as parameters.

    But anyway, you can set e-mail notifications (as many as you want to) and in those notifications you can set recipients to be either “fixed” e-mail addresses (so that’s when you use actual e-mail address in recipient field) or “dynamic”.

    The “dynamic” part relates to the e-mail field on form. So you can e.g. set notification to be sent to a person that submitted the form, to their e-mail address, provided that you put e-mail field on the form. Let’s say you have one e-mail field on the form – then you can use {email-1} as recipient in notification.

    Or you can have multiple e-mail fields and e.g. set conditions for notifications to be sent or not based on other fields’ values; or e-mail routing – in a similar way.

    There is no macro/placeholder for “recipient email” per se because usually:

    – if “fixed” recipient e-mail is set in notification configuration – it’s easy enough to just copy it to e-mail content if you want to include it
    – if “dynamic” one is set – it’s using email field for the form; so such field can also be included in e-mail content (sticking to earlier example: you can put {email-1} into the notification content.

    But with all that said, I’m not quite sure how this recipient e-mail should work and where the actual address would/should come from. Perhaps you could describe it a bit more? Some example case scenario would be great so we could understand it better.

    Kind regards,
    Adam

    Thread Starter Sean

    (@mccues)

    Hi Adam, thank you for the response. As requested, here is a bit more context for what I’m attempting to achieve: The question is regarding displayed fields in the email notification. We’re utilizing the email routing feature to send form submissions to various recipients depending on a certain field’s value. In the email notification, I’d like to display who’s email address the form submission is being submitted to. So I’m assuming the email notification content would look something like this:

    You have a new Form submission:
    {all_fields}
    This notification was sent to {recipient_email}

    The question is, what is the correct value for that variable that will display the recipient’s email address?

    • This reply was modified 7 months, 1 week ago by Sean.

    Hi @mccues,

    Hope this message finds you well.

    Thanks for the explanation, as you explained before you are using Forminator Pro >> Email Notifications >> Recipients >> Email Routing:

    If you are using a static email like in the example, there is no tag to add it to the Email Body, since is not a field.

    But if you are using the email field you should be able to add it using its tag like this:

    https://prnt.sc/P5okSVfbF_Ev

    https://prnt.sc/DB1R2HDmKVMB

    Let us know if you require additional information.

    Best regards,
    Laura

    Thread Starter Sean

    (@mccues)

    Hi Laura, thanks for your response. However, the {email-1} tag references the sender’s email, not the designated recipient. This does not achieve the desired functionality.

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @mccues

    Thanks you for response!

    If its’ about “recipient” then no, there’s no such field.

    What you can do instead and should work would be to use conditional logic for notifications instead of routing.

    That complicates things but is doable: instead of setting one notification with routing configured, you set multiple notifications but without routing.

    Then for each of those notifications
    – instead of “Email Routing” under “Recipients” tab, you simply set a fixed e-mail address for recipient
    – in “Conditions” tab you set conditional logic (send or not send) based on the same field(s) that you used for routing rules earlier
    – and in “Email” tab you modify e-mail content accordingly e.g. including that recipient e-mail address manually etc

    This way you’d end up with multiple notifications and each one would be tailored in terms of content for specific recipient while still being send or not conditionally based on the selections made on the form.

    This is the workaround that should do the trick for you.

    Kind regards,
    Adam

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @mccues

    I hope you are doing well.

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

    Best Regards
    Patrick Freitas

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Form field for email recipient’ is closed to new replies.