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

Contact Form: send to selected person/email

form

Solved by Justin Young View solution

Started by Justin Young 7 years ago · 1 replies · 916 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 Japhy, 2 weeks ago
2 261 4 days ago
Forms & Blueprints · by FrViPofm, 4 weeks ago
5 326 4 weeks ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2317 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 779 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 868 10 months ago