How to Send Quiz Results to Gmail using Zapier
Using Zapier to send Lantern quiz results to Gmail provides an efficient way to automate your customer interactions. In this detailed guide, we’ll walk you through the steps to set up the integration, ensuring quiz results are sent automatically to your Gmail account. This setup is useful for businesses looking to streamline customer communication by automating the quiz result process.
Step 1: Create a New Zap
Start by creating a new Zap in your Zapier account. Once you’ve logged into Zapier:
1. Click on Create
2. Give your Zap a descriptive name, such as “Send Quiz Results to Gmail.”
Step 2: Set Up the Trigger
The trigger is the event that initiates the Zap. In this case, the trigger will be when a quiz is completed in the Lantern Quiz App.
1. Click on Trigger and search for the Lantern Quiz App.
2. Select Quiz Completion as the trigger event. This means the Zap will start every time a quiz is completed.
3. When connecting your account for the first time, you’ll be prompted to enter your Shopify URL and Quiz API Key.
To get your API key, head to Lantern, go to the Integrations section and click Reveal to copy it.
4. After connecting your Lantern account, select the specific quiz you want to use in the integration.
5. Make sure the trigger is set to True so that it activates only when an email address is capture during the quiz.
6. Finally, once the trigger is set, test it to ensure Zapier can pull the quiz completion data successfully. If the test is successful, you’re ready to move to the next step.
Step 3: Retrieve Product and Quiz Data
Before sending the quiz results to Gmail, you need to gather the relevant data from the quiz, including product details and the customer’s answers.
1. Add a new Action step and select Code by Zapier.
2. Choose Run JavaScript as the action event. This will allow you to loop through the quiz data and collect the necessary information for the email.
3. In the next step, you’ll store important data points, such as:
- Product Titles
- Product Images
- Product Prices
- Product URLs
- Questions
- Answers
4. Once you’ve defined the variables for each data point, copy and paste the following JavaScript code into the input field in Zapier.
5. Click Continue and run a test to verify that the JavaScript is pulling and organizing data correctly. This ensures all relevant information will be available for the email.
Step 4: Configure Gmail to Send Quiz Results
Now that the quiz data has been retrieved, it’s time to set up the Gmail action, which will send the quiz results to the recipient.
1. Add another Action step and search for Gmail.
2. Select Send Email as the action event.
3. Connect your Gmail account, or choose an already connected account.
4. Configure the email fields:
- In the To field, select the recipient's email address from the quiz completion data.
- In the From field, enter the email address you want to send from (e.g., your company’s email or a designated support email).
- Customize the Subject line, possibly pulling dynamic content from the quiz event, such as the quiz name.
5. In the Body section, set the Body Type to HTML
- Paste in the HTML template provided, where you can customize elements like your company’s logo, formatting, and overall design.