The KnowledgeSync send email feature is typically used to deliver a static email composed of an email body with KnowledgeSync alert data merged into it and perhaps a report output or static file added as attachments. There is another less known capability in KnowledgeSync that allows you to attach files dynamically.
This is a great feature if you want to be able to programmatically send out an email with an attachment that varies based on some conditions. To do this all you need to do is the following:
In the query definition used by the KnowledgeSync email event, add a column called “attachment_files”. The column name must match this exactly and is case sensitive. When the email server processes an email event using a query that contains this special query column it will attempt to attach whatever file is specified in this “attachment_files” column.
This means the attachment_files column should contain a UNC path to a file. You can even have it attach multiple files by using a comma delimited list of UNC file paths in this column. For instance “\serverfoldermyfile.doc, \anotherserverfolderaPicture.jpg”.
If the path contains an invalid file path the email server will skip attaching the file and send out the email without the attachment(s). It is important to also note that the KnowledgeSync service user account needs access to the UNC paths so that it can access the files specified.