Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Contact Form: send to selected person/email

form

Solved by Justin Young View solution

Started by Justin Young 7 years ago · 1 replies · 976 views
7 years ago

How do I create a contact form that sends to a selected person/email?

I've tried this in the fields section:

YAML
    to:
    type: radio
    label: Choice
    default: b[email protected]
    options: 
         b[email protected]: Bob
         j[email protected]: Jane

with this in the process section:

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

But I get the following error:

TXT
    0 - Address in mailbox given [] does not comply with RFC 2822, 3.6.2.

This post is helpful, but I still cannot get it to work.

7 years ago Solution

Solved: I omitted "name" in front of "to:"

Thus, this does work:

YAML
        name: to
        type: radio
        label: Choice
        etc.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by TomW, 3 weeks ago
3 275 3 weeks ago
Forms & Blueprints · by Japhy, 1 month ago
2 522 1 month ago
Forms & Blueprints · by FrViPofm, 2 months ago
5 520 2 months ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2511 9 months ago
Forms & Blueprints · by Hugo Oliveira, 10 months ago
0 956 10 months ago