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.

Forms & Blueprints

Contact Form: send to selected person/email

form

Solved by Justin Young View solution

Started by Justin Young 7 years ago · 1 replies · 649 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 Ton Haarmans, 5 years ago
13 1135 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 134 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 108 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 127 7 months ago