1

I'm using the Craft Contact Form template. I need to include some additional content in the notification email. I can't for the life of me find how to do this.

I've seen this: P&T Contact Form Plugin: HTML Email Templates

But not sure how to apply the additional fields. Here is my contact form template (markup removed for ease of reading).

{# form markup #}
    <select class='form__input' name="message[About]">
        {% nav link in craft.entries.section('products') %}
            <option value="{{ link.title }}">{{ link.title }}</option>
        {% endnav %}
        <option value="Services">Services</option>
        <option value="Consultancy">Consultancy</option>
        <option value="General enquiry">General enquiry</option>
    </select>
    <div class='input'>
        <label class='form__label' for='fromEmail'>Your email address</label>
        <input class='form__input' id='fromEmail' name='fromEmail' type='email' placeholder='Email address' value='{% if message is defined %}{{ message.fromEmail }}{% endif %}'>
    </div>
    <div class='input'>
        <label class='form__label' for='message'>Details</label>
        <textarea class='form__input form__input--textarea' id='message' name='message' placeholder='Tell us more'>{% if message is defined %}{{ message.message }}{% endif %}</textarea>
    </div>
{# form closing markup/submit button #}

any help, phenomenally appreciated!

Thanks Dave

2

If you look at the GitHub page for the ContactForm plugin under the section for adding additional fields, you'll see that you need to change the name of the message field to message[body]. Try that to see if it helps. I would imagine leaving it as message means that it overwrites the values of the other additional fields.

| improve this answer | |
  • Super... thanks for pointing me in the right direction. – magicspon Mar 4 '15 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.