Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Wrong form configuration?

Solved by elisabetta View solution

Started by elisabetta 5 years ago · 1 replies · 589 views
5 years ago

Hi all!
It looks like I have a lot of trouble in configuring correctly the contact form.
with the following configuration in front matter:

TWIG
email:
   from:
      mail: '{{ config.plugins.email.from }}'
   to:
      mail: '{{ form.value.email }}'
      name: '{{ form.value.name|e }}'
   reply_to: '{{ form.value.email }}'
   subject: '[Contact] New message from {{ form.value.name|e }}'
   body: '{% include ''forms/data.html.twig'' %}'

the mail sent is not received in the correct email post box.
let us say that this box is [email protected] and the sender mail is [email protected],
the form submitted is received at [email protected], but not in the [email protected]
In the email plugin, the "to" and "from" email are configured as [email protected]
Where is the error?

last edited 02/26/21 by pamtbaau
5 years ago Solution

@maria:
form.value.email

Ok! just found the problem: the value

TWIG
to:
   mail: '{{ form.value.email }}'

was overriding the default config plugin to

👍 1
last edited 02/26/21 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Support · by Paul Hodges, 4 weeks ago
19 484 5 days ago
Support · by Lauw, 7 days ago
2 99 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 3 weeks ago