An integral step in executing an email marketing campaign for a leading marketing provider is sending out email lists to email vendors, like Cheetahmail, on a day to day basis. As a marketer, it is very typical of us to pull lists for our clients, sometimes adhoc. In many cases, we send files via SFTP to the email vendor who then sends the email out to the target audience. Now, this is a two-step process:

1. Outputting a list of emails into a file, using Unica Affinium Campaign, to folder Y on the application server.

2. Move the files from Folder Y on the application server to folder Z on the SFTP server for the email vendor to automatically receive.

The files are moved by a scheduled Microsoft SQL job which triggers a Microsoft SSIS package. This package looks out for any file with a specific extension on Folder Y and moves them to Folder Z. This job runs every 15 minutes and is part of a routine Microsoft SSIS package.

In my experience, sometimes the file is moved prematurely or when it’s only half written to the SFTP server. To overcome this problem, there are two solutions:

One is to add a step in your SSIS job which makes sure that the size of the file is not changing (meaning it has been completed) before moving to Folder Z. You should also add another step to the batch file which does the same thing. If you are new to shell scripts then you can use Unix forum to help you out or email me and I’ll be more than happy to assist you. A ‘move’ command on the same server and directory should take minimal time irrespective of the size of the list and would help in solving the problem of files that move prematurely.

The second solution is to add a trigger in your mail list process box which takes care of the problem. A Mail list process box gives you the option of sending triggers after its successful completion. This is a built-in feature and is available across all the versions of Unica Affinium Campaign. This is how it would work.

Check the option of sending triggers in your Mail List Process Box. Let’s call it ‘File_Move_Sample’.


This trigger will then call a batch file which will consist of a basic Unix ‘move’ command to move the file from the new Folder X (where list will be outputted) to Folder Y. The syntax of the batch file would be something similar to this:

MOVE /Y D:\Affinium\Campaign\Initial_folder_location\*.* D:\Affinium\Campaign\Target_folder_location

In a nutshell, both solutions recommend adding one more step of sending a trigger before the job picks up the file and transfers it to the SFTP server. This trigger would then move the file to the desired folder and avoid the issue of sending a premature list to the email vendor saving a lot of inconvenience.

That’s it marketers. Hopefully you’ll find this of some value. What are the error handling checks you use to keep your marketing organizations performing successfully? I’d love to hear them!

Read more: