How to send an email from TaskCentre 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:

1(1)

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

  1. Create a Save File step, within the General tab tick the box Read documents from a source and specify your document Format step.
    2
  2. Within the Main tab specify where the documents will be saved using the Path field.
  3. Drag & drop a recordset column from the task browser into the Filename field, this will automatically name the files based on the column.
  4. Provide the relevant file extension, for example.html. If saving a Crystal Report it will require the extension .PDF.
    3

Format as Text

  1. Create a Format as Text step, within the General tab tick the box Use a Recordset and specify the database query step.5
  2. 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.
    6

Send Email (SMTP)

  1. Within the Send Email (SMTP)step select the General tab. Using the Document Source drop down list select the Format as Text step.
    8
  2. Within the Main tab click on the Attach button to open the Attachments dialog. From here click on Add.
  3. Select the options Dynamic Attachment and Path To File On Disk.
    7
  4. 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

  5. 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.9
  6. Select OK to save and complete configuring the attachment.10

This completes the setting up a task to send multiple email attachments.