How to dynamically include document download links in an email?

Options

I'm building a workflow which will generate documents based on an Excel sheet. These documents need to be emailed to a recipient once generated. Is there a way to build the email function so that if the number of attachments is less than 10, send them as attachments, but if more than 10, include download links in the body of the email?

To that point- I remember seeing a guide on how to create download hyperlinks within emails, but can't find it anymore. How can I generate these links?

Thank you!

Answers

  • Aly_142377
    Aly_142377 Posts: 18 admin
    Options

    Hi Anna,

    I have a few ideas of how this can be addressed, but first, would you mind providing some details surrounding how the generated documents are being created? Once I better understand how they are being created and saved on the run, I can provide a few solutions as to how we can achieve your desired output.

    Thanks!

  • Anna_272419
    Options

    Hi @Aly_142377 ,
    Thanks so much! We use a spreadsheet in the trigger attachment, to fill in blanks of a Word document. The collection of documents in then emailed to the sender. The first part of my question (how to add multiple attachments) I know how to do, the thing I would like help with is the conditional in-line text to provide hyperlinks if the number of attachments is over 10.

    Thanks!

  • Aly_142377
    Aly_142377 Posts: 18 admin
    Options

    Hi Anna!

    I've attached a sample workflow of how you can achieve this behavior.

    To summarize:
    1. Find all of the file fields on the run. My sample workflow makes the assumption that the file attachments are the only file fields on the run. If there will be other file type fields on the run, you can use additional parameters in the field formula to find only the trigger attachment fields (ie, if they have a certain naming convention, etc)
    2. Count the file fields from the previous step in a field formula
    3. Use our new conditional block logic to follow two different paths:
    a. If more than 10 files are found, use a field formula to construct a download link for each file to include in the email body.
    b. If less than 10 files are found, attach the files directly to the email

    Let me know if this achieves the desired results or if you have any further questions!