SMTP;reports

  • 15 Oct

    Q&A 26: Custom SMTP report with filename and transfer timestamp

    Q: Custom SMTP report. I am trying to set up SMTP notifications / Reports that will be sent out once a job runs. I am having the following trouble, I want the email to show the filename and timestamp of when it was transferred, I have this working but if there is multiple files it will send multiple emails, I want a single email per Rule that will one send out one email with file names and time each file was moved.
    A: We’ve added some screenshots to get you started.

    >Please open ‘Rule Events’ Setup in the ‘Moving Rule’ Menu:

    LimagitoX File Mover Rule Events

    >Select and enable ‘On Rule Begin’ event item. Within the ‘On Rule Begin’ event item:

    • Select Pascal Script tab and enable ‘Enable Pascal Script’.
    • Add the following Pascal Script:
    Begin
      // ... add your code here
      psVSA := '';
    End.

    LimagitoX File Mover Rule Events Setup

    >Select and enable ‘On Success’ event item. Within the ‘On Success’ event item:

    • Select ‘Options’ tab and enable ‘Trigger mail event after scan’.
    • Optionally you can enable ‘Enable On Success Events for LimagitoX Temporary Files’.

    • Select ‘Pascal Script’ Tab and enable ‘Enable Pascal Script’.
    • Add the following Pascal Script:
    var
      tmpList: TStringList;
      tmpTime: String;
    Begin
      // ... add your code here
      tmpList := TStringList.Create;
      Try
        // Read from psVSA
        tmpList.Text := psVSA;
        // Add To psVSA
        tmpTime := FormatDateTime('YYYY/MM/DD HH:NN:SS', Now);
        tmpList.Add(psFilePath + psFilename + ' @ ' + tmpTime);
        // Write to psVSA
        psVSA := tmpList.Text; 
      Finally
        tmpList.Free;
      End;  
    End.

    • Select ‘Email’ tab and enable ‘Enable Mail’
    • Setup SMTP server and Email itself. There is a test button available.

    • Important, in the mail body you’ll need to add:  %VSA
      • This %VSA will contain the file information added thanks to the previous Pascal Script

    • We used the gmail smtp server in this example but any other smtp server will work.

    >Result

    If you need any help with this custom SMTP report, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Q&A SMTP
SEARCH