Change Contact Us email subject line or the email address

Jonathan_Shipma
New Member
1 0 1

Looking to direct "contact us" emails to specific email account rather than having them flow through the existing two options:

Shopify Account or Customer Facing Email

 

I've looked through the code on the page.contact.liquid but don't see how to change the subject line or the email address.

Replies 19 (19)
dannytlake
Shopify Partner
7 0 12

+1 please allow subject to be customized via liquid or thru back end gui.

HandHugs
Shopify Expert
175 1 48

Yes please! we use multiple forms on our site and it would be really useful for us to know via a custom subject line which form the email was sent from.

cgregnanin
Tourist
18 0 1
slatted
Tourist
3 0 1

Would definitely appreciate the ability to override the TO Email and the Subject.

yellowwebmonkey
Tourist
4 0 1

+1 for being able to modify subject and reply to

Matthew_Hall1
Shopify Partner
6 0 5

You can't change the subject line or notification email address, but you can can include additional lines in the email you get, which you could use to indicate what form was used.

For instance, if you had an "Ask a Question" form on all product pages, you'd want to know what product they asked a question about.

This example Liquid code will include a line in the email which reveals the product (for use on a product page):

 

          {% form 'contact' %}

          <input type="hidden" name="contact[form]" value="Product page ask a question form - {{ shop.url }}{{ product.url }}">

          <label for="form_name">Name:</label>
          <input type="text" id="form_name" name="contact[name]" value="{% if form.name %}{{ form.name }}{% elsif customer %}{{ customer.name }}{% endif %}">

          <label for="form_email">Email:</label>
          <input type="email" id="form_email" name="contact[email]" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">

          <label for="form_message">Message:</label>
          <textarea rows="10" id="form_message" name="contact[body]">{% if form.body %}{{ form.body }}{% endif %}</textarea>

          <button type="submit">Send</button>

          {% if form.posted_successfully? %}
            <p>Thanks for submitting your question!</p>
          {% endif %}

          {% if form.errors %}
            {{ form.errors | default_errors }}
          {% endif %}

          {% endform %}

 

The hidden inputs are what makes this work, set them to whatever value you want.

The line in question is this:

          <input type="hidden" name="contact[form]" value="Product page ask a question form - {{ shop.url }}{{ product.url }}">

 

The "form" bit in "contact[form]" within the name attribute on the input element is what names your custom field. When you receive the email, this will be included as an extra line with the contents as specified in the value attribute.

E.g.

Matthew_Hall1_0-1595499576900.png

 

If this is an acceptable answer for you, please mark this as an accepted answer to help others find it

Matthew

Conversion Rate Optimisation Experts - Visit https://hallway.agency
3dchimera
Tourist
3 0 3

+1 looking for this functionality

cescapesca_86
Excursionist
20 0 13

I'm also looking for this functionality, at least to be able to change the subject line.

kevinPopkorn
New Member
1 0 0

+1, much needed functionality. Now it's very cluttered and there's no way to at-glance see where the email came from or what it's purpose is without having to check the contents. Being able to set the subject line would fix this.

arielle_p
New Member
1 0 0

+1. Would love to see this update