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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Wrong form configuration?

Solved by elisabetta View solution

Started by elisabetta 5 years ago · 1 replies · 470 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 Thomas, 1 week ago
2 53 11 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago