We Use Cookies

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with this.

See our cookie policy.

Automation Action: Process Attachments

Automate saving attachments to specific folders on your file system.

Built-In Action

Save attachments to specific folders on your file system.

Specify the File Mask for the extensions you want to save.

For example: *.pdf to save all files with the extension .pdf. Use *.* to save all attachments. You can specify multiple masks separated by commas, for example: 'quote*.pdf, invoice.*.pdf, *.doc'. You can create multiple Save Attachment Actions in the same Automation if you need to process different file types differently.

In the Save To Folder select the folder on your file system to save the attachments to. This can contain %variable% replacements.

For example: To save all attachments to sub folders based on the senders email address use 'C:\Attachments%Msg_From%\'.

The directory will be created if it does not exist.

Renaming Attachments

In the Rename Saved Files To entry you can optionally specify a new name for the file. You can use %fieldname% replacements in the Rename to - for example: order%OrderNumber%.csv would rename the attachment order1234.csv if the %OrderNumber% field contained '1234'.

You can use the special field replacement %filename% to use the original file name as part of the renamed file. For example, suppose the incoming attachment was called "orderdata.csv" and the %OrderNumber% field was set to '1234' - renaming to: %filename%No%OrderNumber%.csv would rename the file 'orderdata_No_1234.csv'.

If your rename string doesn't contain a file extension then the original extension will be used. For example: If the attachment is called 'attachment.csv' and you rename it to %OrderNumber% - then the attachment will be renamed '1234.csv' (assuming the %OrderNumber% field has a value of '1234').

You can assign the saved path and file name to a ThinkAutomation variable. Select the variable to assign using the Assign Saved Path To list. Multiple saved attachments will be separated by commas.

Overwrite Existing Files

Check this box if ThinkAutomation should overwrite existing files.

Append Key To Filename To Make Files Unique

If this option is selected then ThinkAutomation will append a date and time stamp to the file name (including renamed files) to ensure that the file name is unique. The time stamp is in the format yyyymmddhhmmss_x

For example: order123420120307122033_1.csv

Would be save for file order1234.csv on 7th March 2012 and 12:20:33. The _1 indicates that this is the first attempt at saving using this file name. If a file already existed with the same time stamp (for example, if ThinkAutomation was processing multiple emails very quickly) the counter would be increased until a unique file was found.

Include Inline Attachments

For HTML emails you can also save inline attachments - these would usually be images embedded in the HTML that don't appear as regular attachments.

Further Attachment Processing

Other actions (such as Convert Document, Convert PDF Document, FTP Upload, Azure Blob etc.) allow specific processing of Attachments.