Re: How to edit contact form e-mail template

How to edit contact form e-mail template

5-MeO-DMT
Shopify Partner
4 0 0

Hello,

Is there a way to edit a contact form e-mail template without any third-party app? I mean the e-mail structure that is sent to some admin/customer support address. Order and shipping e-mail templates can be changed in Settings, but contact form e-mail template cannot.

Replies 2 (2)

Small_Task_Help
Shopify Partner
813 26 71

Hi,

 

Have you checked at contact.liquid , try to modify it ? or you can also go for custom contact form

 

Example code

<form action="/contact#contact_form" method="post" id="contact_form">
  <input type="hidden" name="form_type" value="contact" />
  <input type="hidden" name="utf8" value="✓" />
  
  <label for="ContactFormName">Name</label>
  <input type="text" id="ContactFormName" name="contact[name]" />

  <label for="ContactFormEmail">Email</label>
  <input type="email" id="ContactFormEmail" name="contact[email]" />

  <label for="ContactFormMessage">Message</label>
  <textarea id="ContactFormMessage" name="contact[body]"></textarea>
  
  <input type="submit" value="Send" />
</form>

Script to handle form submission code example

document.getElementById('contact_form').addEventListener('submit', function(event) {
  event.preventDefault();

  var formData = new FormData(event.target);
  // Send form data to an external service or your own server
  fetch('YOUR_EXTERNAL_SERVICE_URL', {
    method: 'POST',
    body: formData
  })
  .then(response => response.json())
  .then(data => {
    console.log('Success:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
});
To Get Shopify Experts Help, E-mail - [email protected]
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
5-MeO-DMT
Shopify Partner
4 0 0

I am looking for a template file/editor for the e-mail that is sent, not the form template.