How to send the email/notification when the documents/batch get to Verification Stage

Questions:

I would like to send an email or notification when a document/batch hit the Verification Stage

Solution:

In the project-> Project Properties-> Advance workflow->create a custom script stage and give it a name such as EmailNotificationScript and place it right before the Verification stage

mceclip0.png

 

Inside this script, use this C# script, (if you are using a Gmail account to send the notification)

using System;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;


MailMessage message = new MailMessage();
SmtpClient smtp = new SmtpClient();
message.From = new MailAddress("mygmailaddress@gmail.com");
message.To.Add(new MailAddress("sendtoemailaddress"));
message.Subject = "Test";
message.IsBodyHtml = true; //to make message body as html
message.Body = "Verification Stage";
smtp.Port = 587;
smtp.Host = "smtp.gmail.com"; //for gmail host
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("mygmailaddress@gmail.com", "mypassword");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Send(message);

 

 

 

 

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

4 comments

  • Avatar

    Thong Pham Hoang Nguyen

    Hi,

    I tried but ABBYY didn't send mail, is there any system requirement or need to be Cloud version,...

    Thank you.

    0
  • Avatar

    Ban Tran

    Hi Thong,

    The script should work if you are using Gmail as the sender because the configuration setting is for Gmail.

    Since it is C#, my guess is you need to have the .Net framework installed. I just test the script again to make and it worked when I provide my Gmail address.

    One possible setting you may check when you are using the Gmail address is to go into your Gmail settings and under the Security option, make sure the "Less secure app access" is turned ON.

    0
  • Avatar

    Thong Pham Hoang Nguyen

    Hi Ban Tran,

    Thanks for your detailed explanation.

    I tried running the workflow on FlexiCapture but it doesn't seem to work. Does this Workflow require uploading to the ABBYY server (Distributed) or Cloud version? Does this script work with other mail servers or only accept Gmail? I think it accepts all mail servers because this is just a script haha

     

    0
  • Avatar

    Ban Tran

    Hi Thong,

    The script is part of the Workflow so as long as you import the document thru the Workflow process, then it will work. So it doesn't require to be uploaded to the Server or Cloud. But of course, if you want to process your document automatically then uploading the project to the server (Distributed/Cloud) is the way to go.

    For example, regardless you are using the local project or the project that was uploaded to the Server (Distributed), if you manually drag & drop the image into the project, then it will not work as the way you import the image is not part of the workflow.

    If you set up the images to import from Hotfolder, Email (pop3/imap/mapi/msgraph), FTP, sFTP, etc.. then the FlexiCapture project will process these images as part of the workflow.

    Regarding the script, as you already said, it is just a script so it should work with others as well, just this example I'm using Gmail so I provide the configuration for Gmail. For example, if you process with Yahoo mail then the configuration will be different (and you will need to check from the Yahoo site to see what are its configuration to send out the email. For example, the Port and the Host will be different than Gmail).

    0

Please sign in to leave a comment.