BoxLang 🚀 A New JVM Dynamic Language Learn More...
DPD DE CFML provides a wrapper for DPD DE functionality. At present, the module only includes access to SFTP file download for tracking events.
box install dpddecfml
Check out the /examples
folder for an example.
The DPD DE CFML wrapper consists of a single model to manage the connection to the DPD SFTP server to download and process tracking event files. The wrapper may be used standalone, or as a ColdBox module.
DPDDEEvents = new models.events(
sftpUsername = 'accountnumber'
, sftpKeyFile = 'path/to/keyfile.ppk'
);
DPDDEEvents = getInstance("events@DPDDECFML");
alternatively inject it directly into your handler
property name="DPDDEEvents" inject="events@DPDDECFML";
When using with ColdBox, you'll want to insert your authentication details into your module settings:
DPDDECFML = {
sftpUsername = getSystemSetting("DPDDE_SFTPUSERNAME", "")
, sftpKeyfile = getSystemSetting("DPDDE_SFTPKEYFILE_PATH", "")
}
Tracking event files are uploaded to the DPD SFTP server every 20 minutes or so. The events component can be used to list, download and process these files.
fileList = DPDDEEvents.getFileList();
fileContents = DPDEvents.processRemoteFiles(
dateRange = '2021-01-01,2021-01-31'
, removeFromServer = false
);
Written by Gary Stanton.
https://garystanton.co.uk
$
box install dpddecfml