NOTE: This article has been updated and moved to the Codeless Platforms Documentation Portal.
If you are seeing this message and have not been redirected, click: How to Send an Email with Multiple Attachments.
<!– This knowledgebase article will show how a task can be configured to send an email to a user with multiple attachments.
Scenario
You have a task that e-mails order information to customers. The requirement is as follows:
A customer with multiple orders is to receive an e-mail with multiple attachments. Each attachment contains the details for each order. (Customers with a single order would receive one attachment.)
This can be explained by using an example task:
In this example each individual invoice is first saved to disk using a dynamic filename. A Format as Text step is used to group the invoices together based on the Customer name by using the option “New document when column changes”. The invoices are then attached to an email as a Dynamic Attachment and using the option “Each Time Column Changes”.
This will allow a customer to receive invoices for their specific orders.
Save File
- Create a Save File step, within the General tab tick the box Read documents from a source and specify your document Format step.
- Within the Main tab specify where the documents will be saved using the Path field.
- Drag & drop a recordset column from the task browser into the Filename field, this will automatically name the files based on the column.
- Provide the relevant file extension, for example.html. If saving a Crystal Report it will require the extension .PDF.
Format as Text
- Create a Format as Text step, within the General tab tick the box Use a Recordset and specify the database query step.
- Within the Formatting tab select the option New document when column changes and use the drop down list to select a common column which will group the documents together on output.
Send Email (SMTP)
- Within the Send Email (SMTP)step select the General tab. Using the Document Source drop down list select the Format as Text step.
- Within the Main tab click on the Attach button to open the Attachments dialog. From here click on Add.
- Select the options Dynamic Attachment and Path To File On Disk.
- Provide the save location of the output documents in the following format and as it appears in the Main tab of the Save File step:
[PATHNAME] \ [FILENAME] . [EXTENSION]Example:C:\Users\Administrator\Desktop\Orders\{=ThisStep.DocumentSource.RecordSet(“Order Number”)}.html
- Within the Options tab select Each Time Column Changes.Use the drop down list to select the column used as the dynamic value for the document filename.
- Select OK to save and complete configuring the attachment.
This completes the setting up a task to send multiple email attachments. –>