top of page
Filter by Category

13:34

7099

The Wix Wiz

How To Send Triggered Emails on a Wix Website | Unlimited Email Automations | Velo Tutorial

How To Send Triggered Emails on a Wix Website | Unlimited Email Automations | Velo Tutorial


Hey there, fellow web sleuths and digital creators! Today, we're unraveling the mysteries of triggered emails on Wix, giving you the power to send those automatic emails like a pro, thanks to the magic of Wix Code (or Velo, as the cool kids call it).


So sit down, grab a cup of your choice of beverage, and let's dive into the nitty-gritty of transforming that simple contact form into a fully-functional automated email machine! 😎


The Big Picture


Imagine adding a touch of class with a personalized thank-you email each time someone connects through your contact form. Triggered emails allow you to maintain seamless communication without lifting a finger after the initial setup. And guess what? It’s all possible with Wix! Just enable dev mode, and let's get started on this nifty journey!


Setting the Scene


We’ll start the journey by prepping a custom form. Our form has these elements: first name, last name, email, submit button, and a cheeky thanks text that pops up upon form completion. Oh, and in case you were wonderin', yes, you need dev mode switched on! Look for it in the top-right corner, give it an enthusiastic click, and you’re all set.


Now, let’s have a quick recap of the prior episode—our former antics involved saving user info as contacts. If you need a refresher, do check it out!


Walking Through The Code


Once dev mode is up and running, drop down to indulge in some code. Our initial task was all about saving contacts using Wix’s contact API. But life doesn't stop at saving, does it? The real magic happens post-contact creation when it’s time to shoot off some emails: both to the user and to our admin self.


Let's create some wizardry. Head on over to dashboard > developer tools > triggered emails and bask in fresh email automation glory. Starting from scratch? No worries—you'll see a setup screen. Been there, done that? Then just fly straight to creating a new triggered email!


Crafting The Perfect Email


Your email template is your canvas. Add first names, last names—basically throw in variables to your heart's content. A tip? Use the magic squiggly braces, like so: `${variableName}`. Once the format feels right, confidently hit save and publish.


Post publishing, a summary will reveal your new headliner—the email ID. It's always courteous to replace its original robotic ID with something more personable, like `contact_form_ID` for easy reference later on.


Mastering The Code Snippets


In your summary, you’ll notice two snippets:


1. Email New Contacts: Use for sending to potential contacts.


2. Email Site Members: Tailored for admins and existing site members.


We're gonna paste these snippets strategically into our code, starting with our admin email section. Ensure your imports are lovingly nestled at the top, and swap your member ID placeholder by digging through your database. You can conjure an impromptu collection, expose the owner, and et voilà—your very own member ID.


After defining your email variables (first name, last name, email), you'll hit our magnificent publish button again. Fire up your landing page in incognito and watch your newly minted triggered emails appear in your inbox—like magic!


Handling Errors & Testing


Life has errors, and so does code. Incorporating a good ol' try-catch block ensures you can gracefully handle those pesky error pop-ups, ensuring robust and failure-resistant communication.


These steps essentially arm you with your custom communication ecosystem, crafting a seamless user contact experience that's both professional and personal.


That’s a Wrap


We’ve journeyed from form setup, email creation to sprinkled logic through Wix Code. Feeling empowered? Time to harness this back-end sorcery across your stellar projects!


At NewForm, we absolutely love unleashing your potential. Why not step beyond this tutorial by joining our community? Regular challenges, expert sessions, and endless creativity fuel your path to becoming a design aficionado. Join NewForm today to rocket your skills to the next level!


Now, go forth, and happy coding! 🚀✨


Remember that every successful journey begins with a single step. Whether you’re enhancing your coding prowess or crafting robust automations, you’re always welcome to step over to NewForm. Dive into more tutorials, events, and a bustling network of creative minds just like yours. Until next time, keep creating!

bottom of page