Send Page as PDF Attachment via Email

Send Page as PDF Attachment via Email

Requirements

Schedule an email to send a Zoho Creator page as a PDF attachment at defined time intervals using Deluge's sendMail task.

Use Case

To support customer engagement and business promotion, an organization uses the Pages feature in Zoho Creator to create a newsletter featuring customer testimonials, metrics, and product sales count. This newsletter will be shared with subscribed customers on the first day of every month via email in the form of PDF attachments.
Note: The page will be downloaded as a PDF via API and sent as an email attachment. 

Steps to Follow

  1. Create a form with the following details to add customer details.

    Form

    Form Link Name

    Field Type

    Field Name

    Field Link Name

     

     

    Customer Details

     

     

    Customer_Details

    Name

    Customer Name

    Customer_Name

    Email

    Email

    Email

    Phone

    Phone

    Phone

    Address

    Address

    Address

    Decision box

    Subscribe to monthly newsletter

    Subscribe_to_monthly_newsletter

  2. Create a page named Newsletter and customize it as necessary.
  3. Note: It is not recommended to have embedded forms or reports in the page, as it restricts the the ability to download the page through the API.

  4. Publish the Newsletter page that you want to send as attachment.
  5. Note: Kindly refrain from including sensitive information on this page, as it will be publicly accessible to everyone via permalink upon publishing.
  6. Create a schedule workflow to run on the first day of every month. Select the start date and time as the first day of a month and time as per your preference, here we have set date as 01-Dec-2023 and Time as 07:00:00 Hrs. Set the frequency of the workflow to run Monthly and name it as Email Newsletter.

  7. Click Add New Action and select Deluge Script. Add the below script to the editor and save.
Note: Mail can be sent only to a maximum of 340 addresses at a time through Deluge send mail task through the below code. For handling more than 340 addresses, proceed to the next snippet.
  1. Utilize the below script to send mail to less than 340 email addresses.
  1. //Download the Creator page as PDF file using the invokeurl task.
  2. fileResp = invokeurl
  3.   [
  4.    url :"https://creatorapp.zohopublic.com/export/<adminUserName>/<appLinkName>/pdf/pageLinkName>/<encryptedKey>?isc5page=true"
  5.    type :GET
  6.   ];
  7. //Fetch the email addresses of all customers subscribed to newsletter.
  8. emailList = Customer_Details[Subscribe_to_monthly_newsletter = true].Email.getAll();
  9. //Send mail to all email address in the list, including the downloaded PDF file as an attachment.
  10. sendmail
  11.   [
  12.    from :zoho.loginuserid
  13.    to :emailList
  14.    subject :"Zylker Corporation Newsletter"
  15.    message :"Greetings form Zylker Corporation, We are thrilled to share our newsletter of November 2023 with you. Have a great day"
  16.    Attachments :file:fileResp
  17.   ] 

.

  1. Utilize the below provided code when handling email lists containing more than 340 email addresses.
  1. //Download the Creator page as PDF file using the invokeurl task.
  2. fileResp = invokeurl
  3.   [
  4.    url :"https://creatorapp.zohopublic.com/export/<adminUserName>/<appLinkName>/pdf/<pageLinkName>/<encryptedKey>?isc5page=true"
  5.    type :GET
  6.   ];
  7. //Fetch the email addresses of all customers subscribed to newsletter.
  8.  emailList = Customer_Details[Subscribe_to_monthly_newsletter = true].Email.getAll();
  9.  batchSize = 340;   //To determine the number of email addresses to include in each batch of emails.
  10.  emailBatch = List();   //Empty list to store the email addresses for each batch. 
  11.  index = 0;    //Counter to keep track of the number of email addresses that have been added

  12. // Iterate over the list of email addresses and send email in batches. 
  13. //If the index reaches the maximum batch size, send the email to the complete batch of 340 email addresses and reset all variables. Otherwise, add the current email address to the emailBatch and increment the index variable until the batch is complete. 

  14.  for each  email in emailList
  15.  {
  16.   if(index >= batchSize)
  17.   {
  18.   sendmail
  19.   [
  20.    from :zoho.loginuserid
  21.    to :emailBatch
  22.    subject :"Zylker Corporation Newsletter"
  23.    message :"Greetings form Zylker Corporation, We are thrilled to share our newsletter of November 2023 with you. Have a great day"
  24.    Attachments :file:fileResp
  25.   ] 
  26.    emailBatch = List();
  27.    index = 0;
  28.   }
  29.   emailBatch.add(email);
  30.   index = index + 1;
  31.  }
  32. //If there are any remaining email addresses after the last batch, send them as final batch of emails.
  33.  if (emailBatch.size() > 0)
  34.  {
  35.   sendmail
  36.   [
  37.    from :zoho.loginuserid
  38.    to :emailBatch
  39.    subject :"Zylker Corporation Newsletter"
  40.    message :"Greetings form Zylker Corporation, We are thrilled to share our newsletter of November 2023 with you. Have a great day"
  41.    Attachments :file:fileResp
  42.   ]
  43.   }
Substitute the variables in the preceding script with pertinent data, as indicated in the table provided below:

<adminUserName>

is the username of the person who owns the application.

<appLinkName>

is the link name of the application.

<pageLinkName>

is the link name of the page that needs to be downloaded via API.

<encryptedKey>

is the unique key that is generated while publishing the page. It can be located within the URL of the published page. For example, in the following publish URL: https://creatorapp.zohopublic.com/zylker/customer-relationship-manager/page-perma/dashboard/HPtR6ZeWSEJW4TwCS2rJOCCg2k1QJZAmrngnbhVECqCWtER8FmDzEdspDwMySSsAMR9gd6PW79jNwa3gp4kjvfez9UJCp4SrmBfU

the encrypted key is as follows: HPtR6ZeWSEJW4TwCS2rJOCCg2k1QJZAmrngnbhVECqCWtER8FmDzEdspDwMySSsAMR9gd6PW79jNwa3gp4kjvfez9UJCp4SrmBfU

 

See How it Works


  1. Understand publishing a page
  2. invokeURL
  3. sendMail
  4. Understand Schedules

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        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







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsRetailOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceForms for Solopreneurs
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit
                              Forms for Government
                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic FormsInsurance
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsWufoo alternativeEncrypted Forms
                              Accessible FormsTypeform alternativeSecure Forms

                              WCAG

                                          Create. Review. Publish.

                                          Write, edit, collaborate on, and publish documents to different content management platforms.

                                          Get Started Now






                                                            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

                                                                  Use cases

                                                                  Make the most of Zoho Desk with the use cases.

                                                                   
                                                                    

                                                                  eBooks

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

                                                                   
                                                                    

                                                                  Videos

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

                                                                   
                                                                    

                                                                  Webinar

                                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                                   
                                                                    
                                                                  • Desk Community Learning Series


                                                                  • Meetups


                                                                  • Ask the Experts


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner



                                                                    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 Demo

                                                                                                      Get a personalized demo or POC

                                                                                                      REGISTER NOW


                                                                                                        Design. Discuss. Deliver.

                                                                                                        Create visually engaging stories with Zoho Show.

                                                                                                        Get Started Now










                                                                                                                            • Related Articles

                                                                                                                            • Automatically create daily reports and send current day's reports as email attachment

                                                                                                                              Requirement Schedule custom actions to automatically create labour reports everyday at the specified time and send a filtered report of all the reports corresponding to the current day as an email attachment. Use case Let's assume your company has ...
                                                                                                                            • Understanding sending an email notification

                                                                                                                              Understanding sending an email notification on form submission You can enable your users to automatically receive an email notification when they submit an entry through your form. Most importantly you can send this email from a different From ...
                                                                                                                            • Send Record Template as an Attachment in Mail

                                                                                                                              Requirement Send a record summary as a PDF attachment via mail using the Deluge's send mail task. Use Case Consider an organization using Zoho Creator to manage POS operations. Whenever an invoice is generated, the invoice record template is promptly ...
                                                                                                                            • Configure send email action

                                                                                                                              To improve email deliverability, we will be following an updated email handling policy, effective from September 19, 2024. This means that any public and unauthenticated custom domain email addresses cannot be used as sender addresses in send mail ...
                                                                                                                            • Understanding page builder

                                                                                                                              1. What does this page cover? Learn about the page builder and how you can customize your page and its elements according to your business needs. 2. Availability Pages can be created in all plans of Creator. Only the super admin, admins, and ...
                                                                                                                              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