1

We are using for our first CraftCMS website:

  • Sprout forms
  • Sprout e-mail

In our "sprout-forms/entries" all entries show up. So all fields got saved perfect. Now we would like to send to an e-mail a confirmation message with the same form fields.

So I created a notification, you can find a screenshot in the attachment.enter image description here

Now we wonder, what do we have to do to when a user submits the Contact form that de form field values are being sent to a email address we specify in the notification to: field?

When I test the notification using the 'test' button in the overview it works perfect. In production/contact form on the website it fails.

Thanks a lot!

1 Answer 1

1

There are a couple of things I'm seeing above that may be your issue.

First, this is a question about Sprout Forms and it looks like your email is form-related however the Notification Event you have selected is for Craft Entries ('When an entry is saved'). If you want to trigger an email when a Form Entry is saved you'll want to select the Sprout Forms Notification Event: 'When a form entry is saved'.

Second, the 'Basic Notification' template is not going to support custom Twig code in the Body field. So, if you want to use custom twig code you'll have to create custom email templates.

With those items updated, now that you have the Sprout Forms event selected, the event will provide you with the Form Entry Submission that triggered the event as an object variable to your template, so you won't need to try to find it using lastEntry and can access the form using the object variable instead. See: Personalization and Object Syntax doc pages for more on how those work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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