Opt in/out of email subscription | Zoho Creator Academy

Opt in/out of email subscription

Requirement

Users should be able to choose if they want to subscribe to or unsubscribe from a periodic newsletter email.

Use Case

A fintech company sends monthly newsletters to its customers. Customers should have the option to subscribe or unsubscribe to the newsletter at any point of time.

Steps to follow

1. Create two forms with the following details.

Form

Form Link Name

Field Type

Field Name

Field Link Name

Opt In

Opt_In

Add Notes

I want to receive updates

plain

Name

Name

Name

Email

Email

Email

Opt Out

Opt_Out

Add Notes

I do not want any further updates

plain

Email

Email

Email

Name

Name

Name


The Opt In form is used by customers to sign up for the monthly newsletter. The Opt Out form is used by customers to unsubscribe from the monthly newsletter.
2. Create workflow with the following details to restrict duplicate email IDs.



We are using the Form Event as Validations on form submission so that the entered email address can be checked before the data is added to the database.

3. Click Add New Action and add the following snippet in the Deluge editor.
  1. // check if any duplicate records exist and alert the user if yes
  2. duplicate_records_count = Opt_In[Email == input.Email].count();
  3. if(duplicate_records_count != 0)
  4. {
  5. alert "This email is already registered for updates";
  6. cancel submit;
  7. }
Note: The No duplicate values field property can also be used to prevent duplicate entries. However, we have used the script to display a customized alert message.

Now let's add workflows to the Opt Out form to achieve the following:
  1. Disable Name field 
  2. Fetch data and populate Name field based on the entered email address
  3. Display an alert when then entered email address does not exist in database
  4. Remove the email address from Opt In form after form submission
4. Create workflow with the following details to disable the name field.



5. Click Add New Action and save the following snippet in the Deluge editor.
  1. disable Name;
6. Create a new workflow with the following details.




The Form Event is selected as User input of a field so that the corresponding Name value can be fetched when an email address is entered.

7. Click Add New Action and save the following snippet in the Deluge editor.
  1. // fetch the record containing the email address
  2. fet = Opt_In[Email == input.Email];
  3. // if the record exists, assign the corresponding name to the Name field, and display an alert to the user that the email will be removed from the list
  4. if (fet.Email != null)
  5. {
  6. input.Name = fet.Name;
  7. alert ("This email is registered with the name " + input.Name) + " and will be removed from the updates list";
  8. }
8. Create another workflow as below to display an error if the email is not found/subscribed



We are using the Form Event as Validations on form submission so that the entered email address can be checked before the data is added to the database.

9. Click Add New Action and save the following snippet in the Deluge editor.
  1. // fetch the record containing the email address
  2. fet = Opt_In[Email == input.Email];
  3. // if the email address is not found, display an alert and restrict the form submission
  4. if(fet.Email == null)
  5. {
  6. alert "This email is not registered for updates";
  7. cancel submit;
  8. }
10. Lastly, create a workflow as displayed, to remove the email address from the subscription list on successful form submission.


11. Click Add New Action > Deluge Script, and save the following script in the Deluge editor.
  1. // delete the record in Opt In form which contains the specfied email address
  2. delete from Opt_In[Email == input.Email];

See how it works


Points to note

  1. Permissions can be used to hide the reports from users. 
  2. The email list in the Opt In form can be used to send periodic emails or newsletters using schedules.
  1. Workflows
  2. Form events in workflows 

    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION









                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • FAQs:​ Understand Forms

                                                                                                                This page covers everything you need to know about Zoho Creator, from creating and customizing forms to collecting, editing, and deleting data seamlessly using stateless forms. What is a form and its purpose? Forms serve as a user interface, ...
                                                                                                              • Insert records through email

                                                                                                                Requirement When an email is received, content from the email is extracted and used to create records. Use Case The HR team sends an email to shortlisted candidates. Candidates can reply to the email with details that are extracted and added as ...
                                                                                                              • Copy data from one Address Field to another

                                                                                                                Requirement Copy one Address field to another automatically while filling out a form. Use Case An online e-commerce application generally would ask every customer to enter separate billing and shipping addresses. Sometimes, people have both the ...
                                                                                                              • Limitations:​ Workflows

                                                                                                                Workflow execution A maximum of 120 workflow action calls (requests) can be executed per minute and per IP address. This count includes the execution of the following: Script in the on load form event Script in the on user input form event Script in ...
                                                                                                              • FAQs: Sending Email Notification - On Successful Submission

                                                                                                                This page covers effectively managing email notifications for form submissions, including customization, verification, and optimizing communication channels. What is email notification on form submission, and how can I enable it? Email notification ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources