qwiq Shopify Section Tips & Tricks
Adding a subject to your Shopify contact form to route multiple forms to different folders or emails
Are you looking to set up multiple email contact forms on your Shopify website, each with its own unique subject line for better organization and response management? While Shopify's default contact form allows only one subject line - which is default with no way to edit it, there's a workaround that involves leveraging rules in your email provider to achieve this. In this tutorial, we'll guide you through the process step by step.
Prerequisites:
- A Shopify website
- An email provider that supports rules (e.g., Gmail, Outlook, etc.)
- Basic knowledge of Shopify, HTML and your email provider's settings
Step 1: Locate the Contact Form Section File
If you're using qwiqode's Flexible Contact Form section you can skip this step since we already provde an option to add this hidden HTML field and add your custom subject line via the Theme Editor.
- In your Shopify admin panel, navigate to Online Store > Themes.
- Find the theme you're using and click on "Edit code."
- Locate the liquid file associated with the contact form you want to modify (usually found under Sections or Templates).
- Look for the code block that renders the form fields. This usually looks like this:
{% form 'contact' %}
- Add the following HTML code to create a hidden text field for the subject line:
<input type="hidden" name="contact[ subject]" value="Your Subject Line Here">
Replace "Your Subject Line Here" with the desired subject line for this specific form.
* notice that the word '[ subject]' starts with a space. Keep that space there. - Save your changes.
If you are planning to use multiple forms with different subjects, you'll need to duplicate the section file, rename it and apply the same changes as listed above, but with a different subject line.
Step 2: Configure Email Notifications in Shopify
- In your Shopify admin panel, go to Settings > Notifications.
- Scroll down to the "Form" section and locate the "Contact form" notification.
- Click on "Edit" and ensure that the email address you want to receive form submissions is correctly set.
- Save your changes.
Step 3: Set up Rules in Your Email Provider
Now, let's configure rules in your email provider to assign different subject lines based on the form submitted.
Example using Gmail:
- Open your Gmail account.
- Go to Settings > See all settings.
- Navigate to the "Filters and Blocked Addresses" tab.
- Click on "Create a new filter."
- In the "From" field, enter the email address associated with your Shopify notifications.
- In the "Has the words" field, enter the Subject Line that you entered for the specific form.
- Click on "Create filter."
- Check the box(es) that you want as actions to take when a match has occurred.
- Click on "Create filter."
Example using Outlook:
- Open your Outlook account.
- Go to Settings > View all Outlook settings.
- Navigate to Mail > Rules.
- Click on "Add new rule."
- Under "Add a condition" select "From" and enter the email address associated with your Shopify notifications.
- Click on "Add another condition" and select 'Message body includes" and enter the Subject Line that you entered for the specific form.
- Under "Add an action," select the actions to take when a match has occurred.
- Click on "Save."
Step 4: Test Your Contact Forms
Once you've configured the rules in your email provider, it's time to test your contact forms on your Shopify website. Fill out each form and verify that the emails are being received as you configured.
Conclusion:
By following this workaround, you can create multiple email contact forms on your Shopify website and be able to distribute each separate inquiry to the relevant recipient or location using rules in your email provider. This allows for better organization and makes it easier to manage responses based on the form submitted.
We hope this tutorial has been helpful in enhancing the functionality of your Shopify contact forms. If you have any questions or encounter any issues, feel free to reach out for assistance. Happy form building!