Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Wrong form configuration?

Solved by elisabetta View solution

Started by elisabetta 6 years ago · 1 replies · 684 views
6 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
6 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 webmasterodp, 1 week ago
4 172 1 week ago
Support · by nwhitfield, 1 week ago
2 150 1 week ago
Support · by stell, 3 weeks ago
5 381 2 weeks ago
Support · by gravinator, 1 month ago
5 574 2 weeks ago
Support · by Gravver, 3 weeks ago
6 360 3 weeks ago