contact-form
contact-form copied to clipboard
Additional fields are not sending to mail.
<div class="row">
<div class="col-lg-6 mb-4">
<input id="from-email" type="email" name="fromEmail"
value="{{ message.fromEmail ?? '' }}" class="form-control"
placeholder="Email">
{{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
</div>
<div class="col-lg-6 mb-4">
<input id="phone" type="text" name="message[phone]" value="{{ message[phone] ?? '' }}"
class="form-control" placeholder="{{currentSite.handle == "English" ? "Telephone" : "Téléphone"}}">
</div>
</div>
is message[phone] correct?
yes
@pinkrada try removing {{ message[phone] ?? '' }}
from your input's value=""
@olivierbon I am experiencing the same issue. I add this into your example contact form on the README.md and it never passes to the email template:
<h3><label for="test-zach">Test</label></h3>
<input id="test-zach" type="text" name="message[testZach]" value="{{ message.testZach ?? '' }}">
@olivierbon I am experiencing the same issue. I add this into your example contact form on the README.md and it never passes to the email template:
<h3><label for="test-zach">Test</label></h3> <input id="test-zach" type="text" name="message[testZach]" value="{{ message.testZach ?? '' }}">
Same problem here.
To solve the problem, take a closer look at the documentation.
It's not quite easy to see, but the textarea name attribute is actually set to message[body]
. If you do, you'll then be able to add message[testZach]
on another field and then received it via your email.
<h3><label for="message">Message</label></h3>
<textarea rows="10" cols="40" id="message" name="message[body]">{{ message.message.body ?? '' }}</textarea>
Same here
Is anyone still having this issue? I’m unable to reproduce it; adding the field below to the example form in the docs and updating the message field to message[body]
and all fields show as expected in the email.
<h3><label for="test-zach">Test</label></h3>
<input id="test-zach" type="text" name="message[testZach]" value="{{ message.testZach ?? '' }}">
Will close this out but if anyone is still running into it, let us know.