I have an entry where I select which form displays on the page. Is there a way for me on the entry using a text input for an email address to use that email address for the sending of emails via the sprout form?

So in other words, I have an entry with a selected Sprout Form as well as an email address filled out in the entry, where the selected Sprout Form needs to send the email to. e.g. a hidden field where I can add the email address to, etc.

Any help would be great, thanks.

1 Answer 1


Yes, this is possible. It will require a few steps in a few different places.

In your Form:

  • Create a Form with an Invisible Field (handle: invisibleEmailField)
  • Set the Invisible Field Value setting to match the value of a hidden email Field Variable (that you will define in your Twig Templates below: {secretEmailAddress})

In your Notification Email:

  • Set the Recipient field to the handle of your Invisible Field {invisibleEmailField}

In your Section:

  • Create an Email Address Field (handle: notificationEmail, type: Plain Text Field or Email Field)
  • Create a Form Relations Field (handle: selectedForm, type: Form Relations Field)
  • Define the email address you wish to use in your Plain Text field
  • Create a relationship to your form

In your Twig Template:

Use the addFieldVariables tag to make your Entry's Email Address value available to your Invisible Field. Your page template would look something like the following:

{# Use the addFieldVariables tag to make variables 
   available to the Invisible Field settings
   This tag has to come before the `displayForm` tag. #}
{% do craft.sproutForms.addFieldVariables({
    'secretEmailAddress': entry.notificationEmail
}) %}

{% set formHandle = entry.selectedForm.one().handle %}

{# Output the Form selected in your Form Relations field #}
{{ craft.sproutForms.displayForm( formHandle ) }}

When this form is submitted, the secretEmailAddress value is available to be processed by your Form's Invisible Field. And when the Notification Email is triggered, the Notification Email has access to the submitted Form Entry which has your custom Invisible Field.

  • Ok, so the client will have to add new forms to the notification email every time they create a new one. Unless, they just use the same form every time, mmm. As I don't think the fields change every time per Lead Form. Sorry, thinking out loud, lol. Thanks a mil Ben! :) Commented Feb 18, 2019 at 4:20
  • I seem to be running into an issue. When I try and add the field to the recipient email field I get the following error. Dynamic {invisibleEmailField} attribute does not exist. I have added the field to the form as instructed. Also the value of the hidden field doesn't seem to pull through, is this correct? Commented Feb 18, 2019 at 7:48
  • The above issue was a bug and is resolved now. Commented Feb 24, 2019 at 22:56
  • I have a question with regards to this. Is it supposed to save the data to Sprout Forms in the field that has been created? As it isn't saving anything to the form field. Commented Jun 26, 2019 at 8:31
  • @NicoleLambon Yes. The Invisible Field will store a value that you submit to it. If it's not saving, it's possible you have a syntax error. The easiest way to test if it's working would be to just hard code a "test" value to be saved in the field. If you have questions about syntax, consider opening a new question and providing a few more details about what you have set up and are trying to do and we will figure out what's going on. Commented Jun 27, 2019 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.