Workflow Soluiton

 View Only
  • 1.  Reading an emailbox and manipulating an email content

    Posted Jul 28, 2011 10:14 AM

    Hi everyone.

    I am trying to develop a workflow that monitors an emailbox and everytime an email is sent to this mailbox, workflow need to open the email and based on it´s content act acordingly.

    My first problem is: How do I monitor a POP3 / IMAP mailbox and open the emails?

    Seconde, after I am able to read the email, how can I get all it´s components into variables so I can manipulate them (sender, recipient, subject, body (html), priority, attachments....)

     

    I will have to recreate the email after some approvals happens. So with the sendmail component, if I´ve got the variables already populated with the original email content, I would be able to recreate it. But for now, I don´t know how to get the contents of the original email.

     

    Any help, would be greatly appreciated.

     

    Regards,



  • 2.  RE: Reading an emailbox and manipulating an email content

    Posted Jul 28, 2011 11:25 AM

    If you have access to a ServiceDesk build, there's an EmailMonitoring process that comes with it.

    If you don't, well, it basically makes use of the LogicBase.Components.Email DLL (not loaded by default). When you load that DLL, you'll have a set of components that will help you monitor either POP or IMAP mailboxes. In particular, there are IMAP4 List/Pop3 List components that'll return a set of EmailHeaders that contain to, from, subject and ID info. Using the ID info from the previous component, you can use the IMAP4 Get By ID/Pop3 Get By ID components to get even more information.

    To "monitor" the mailbox, you can use either a monitoring or workflow type project deployed on a schedule to run at specified times.

    Hope this helps



  • 3.  RE: Reading an emailbox and manipulating an email content

    Posted Jul 28, 2011 11:34 AM

    1) In your Workflow project, go to the 'Publishing' tab and in the section called 'Workflow Type', check the "Auto Start" option.

    2) In the 'Auto Start Settings' section, define a 'Schedule'. I set it to an "Every Day Pattern" and then edit that and set the 'Time Pattern' to "Interval" and set that to "00:05:00". This will check the inbox every 5 minutes. Adjust as necessary.

    3) Inside the Workflow project workspace, delete the default 'Start' component and search for an 'Auto Start from Email' component and drag it into your project in place of the normal 'Start' component. See image below for example:

    4) Edit the 'Auto Start from Email' component and on the 'Setup' tab, plug in your settings for connecting to the email inbox, similar to the following image:

    5) Then go to the 'Output' tab to setup the email body type to get and set your Output variable name like the following example shows:

    6) Downstream of the 'Auto Start from Email' component, you will now be able to see the output variable and its properties, like the following image shows. Use that to setup how your Send Email component will be formatted with the variable properties you desire.



  • 4.  RE: Reading an emailbox and manipulating an email content

    Posted Dec 22, 2011 12:18 PM

    Thanks everyone.

    I found out the the Auto Start from Email is broken and needs to be replaced by Configurable Auto Start with a POP3 Get Email component.