I would like to be able to send an email once an entry is made in a form, and in this email, I would like to attach a file that has been added to the form using the ImageUpload (or FileUpload) widget.
So, I started by creating a flow that will trigger when an entry is made on my form, and if one of the fields of my form is equal to "Color," then it sends an email to the address entered by the user in the form.
The SendMail widget in Zoho Flow does not natively allow attaching a file to the email, so I came up with the idea of saving the file in Zoho WorkDrive, then retrieving the name and creating a download link that will be sent in the body of the message rather than as an attachment.
My getFileName function is straightforward; it retrieves the filename from the long string returned by the ImageUpload input:
The name is successfully extracted, so I can use it to retrieve the file in WorkDrive. Where it doesn't work is that the flow triggers before the file is stored in WorkDrive, which seems odd to me because if I understand correctly, if an entry is made, the file should already be uploaded to WorkDrive, thus already existing when my flow starts. However, the email I receive returns nothing. However, if the file is already present in WorkDrive, then everything works, and my download link is created successfully. I tried adding "delays" in different places to ensure that the file is indeed in WorkDrive, but it doesn't change anything.
So, I tried another approach with the Send Mail function of Deluge. I created a custom function named SendMail with a boolean return and properties to make it dynamic:
But once again, for the attached file, the problem is that I cannot directly have the file, but only the "path" text as mentioned above.
And in this case, my function returns "false," so I only receive the error email.
I think there is a solution with "InvokeUrl," but I can't seem to understand how it works and how to link it to my form.
Do you have any ideas on how to receive an email from Zoho Flow with an attachment that is a file uploaded by the user?
To understand my goal, I need a creation request form. I have fields for first name, last name, email, and a list field with multiple choices. Depending on the choice, different new fields appear, and some are ImageUploads. Once the form is submitted, based on the first choice in the list, the email will be sent to different people, and it should be possible to download or view the attached file.
Overview of the Flow:
Writer is a powerful online word processor, designed for collaborative work.