How to attach an inline image in a send mail task

How to attach an inline image in a send mail task

Let's imagine you have a form in your application with an image field. This image can be added as an inline element on the mail body and sent to the desired users along with the Deluge send mail task.
Note:
- In order to insert an image as an inline element in the email, you must first publish the report containing the image or ensure it is a public image with a publicly accessible URL.
- The files that you upload will be scanned for any virus before email submission. You will have to upload a different file if the uploaded file contains a virus.
  1. Create a workflow to execute on your preferred form event.

  2. Click Add New Action > Deluge Script and add the following script to the Deluge editor.

  1. Image_URL = "https://creatorapp.zohopublic.com/file/<account_owner_name>/<app_link_name>/<report_link_name/<recordID>/<image_field>/image-download/<published _key>?filepath=/<file_name>"
  2. //Replace the placeholders with the relevant data, 
  3. //For example, https://creatorapp.zohopublic.com/file/zylker/vendors/All_Logos/4359134000000616055/Image/image-download/O7nQEMHydShGuQvCPOxjqSgfmPD35ObvepUf9VY4BKYYvkYXz1gxB4r3p42AvdAqbVRX6TpZa9vQ83hO3kMdCMrd7ueGyHEA2qxS?filepath=/1706480540283_logo-1913689_640.png

  4. sendmail
  5. [
  6.  from :zoho.adminuserid
  7.  to :zoho.loginuserid
  8.  subject :"Welcome to Zylker Corporation"
  9.  message :"<div>Congratulations and welcome to Zylker Corporation! We are thrilled to have you as a valued member of our community.<br></div><div><br></div><div>Your registration is now complete, and you are all set to explore the exciting features our application has to offer<br><br></div> Regards,<br> Zylker Corporation <br> <img src='" + Image_URl + "'style='width: 100px; height: 75px;'/>"
  10. ]

Note: For a public image, you can directly insert the public URL of the image inside the html image tag, <img src='<Public_image_URL>'>. For example, <img src='https://cdn.pixabay.com/photo/2016/12/17/15/50/logo-1913689_1280.png' style='width: 100px; height: 75px;'"' style='width: 100px; height: 75px>;

Where:

<account_owner_name>

is the TEXT that represents the Creator account owner's username for the application.

<app_link_name>

is the TEXT that represents the link name of the Zoho Creator application.

<report_link_name>

is the TEXT that represents the link name of the report in which the image exists.

<recordID>

is the NUMBER that represents the ID of the record that contains the image.

<image_field>

is the TEXT that represents the field link name of the image field in which the image is uploaded.

<published_key>

is the unique key that is generated while publishing the report. It can be located within the URL of the published report. 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. Send mail