Back to all How-tos

Email Attachments simplified

Since Connect Designer 2018.1 new options are introduced to simplify adding attachments to email messages. We distinguish two flavors: static files (for example a static Terms and Conditions document) and dynamic attachments which are different for each recipient. The latter is typically triggered by data.

Introduction

In previous versions of the software one had to write scripts to achieve this. This was explained in various forum threads and How To’s but the approach wasn’t straightforward. Now we have a way to do this via the user interface and this is how it works.

Static attachments

An Attachments tab has been added to the Email Section Properties dialog. This tab lets you add links to files residing in the Image folder (located in the Resources panel), on disk or in a remote location.

Email Attachments Simplified 1

To add a static attachment:

  1. Right mouse click an email section in the Resources panel and choose Attachments…. The Email Section Properties dialog appears.
  2. Click the plus icon to add a new attachment. The Select File dialog appears. This dialog lets you select a file or specify the remote location. It doesn’t have to be an image file. You may also attach non-image file types like .csv, .doc etc.
  3. Click OK to store the reference and close the dialog.

Alternatively drag and drop a file from the file system or from the Images folder to the icon of the email section in the Resources panel.

Dynamic attachments

The path to Dynamic email attachments is constructed based on the value of a data field. The new Dynamic Attachment wizard lets you concatenate this value with the base location and/or file extension to construct the path. Dynamic Attachment scripts are created via the New option on the toolbar of the Scripts panel.

The following image defines the path by concatenating the value of the prefix field with the value of the selected field (Invoice) and appends the extension, .pdf. The sample below results in:

C:/Attachments/INV2018-246.pdf

There is no need to state the file:// protocol although it does work, e.g.:

file://C:/Attachments/INV2018-246.pdf

Email Attachments Simplified 2

One can also reference remote resources. In that case the prefix should state the url to the folder containing the file (e.g. http://www.mysite.com/somefolder/attachments/):

http://www.mysite.com/somefolder/attachments/INV2018.246.pdf

Tags
Email

Leave a Reply

Your email address will not be published. Required fields are marked *