I am hoping someone can help me with this issue with the File Watcher Plugin.
Basically I am trying to get the File Watcher to send an email notification when a file fails to import. I have setup the email and am able to send emails fine thru the Email Maintenance form.
I have uncommented the appropriate lines of code in the File Watcher Plugin but am getting an error when compiling. I am getting an error of 'Overload resolution failed because no accessible 'CreateBusinessLogic' accepts this number of arguments' on line 728 which is the line of code:
Dim email As JiwaApplication.JiwaEmail.EmailMessage = JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic(Of JiwaApplication.JiwaEmail.EmailMessage)
Any help?
Below is that section of code from the plugin:
- Code: Select all
Catch ex As System.Exception
' Move to failed folder
System.IO.File.Move(pendingFileNameAndPath, Path.Combine(Me.FailedFolder, System.IO.Path.GetFileName(pendingFileNameAndPath)))
LogToEventLog(String.Format("Failed to import File '{0}' - Error: {1}", FullPath, ex.Message), System.Diagnostics.EventLogEntryType.Error)
Dim email As JiwaApplication.JiwaEmail.EmailMessage = JiwaApplication.BusinessLogicFactory.Instance.CreateBusinessLogic(Of JiwaApplication.JiwaEmail.EmailMessage)
email.SystemSettings.UseOutlookForEmail = False ' Cannot use outlook from within a Windows Service - make sure your other system settings like SMTP server are configured.
email.CreateNew()
email.EmailTo = "daniel@***.com.au"
email.EmailSubject = "PO7 File Import Failed"
email.EmailBody = String.Format("Document '{0}' failed to import - error message is '{1}'", pendingFileNameAndPath, ex.Message)
email.Save()
End Try


