Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


bv749
  •  bv749
  • Paid support Topic Starter
2017-06-23T20:22:12Z
I receive a daily email that contains the out of a report in a csv file. The csv file is not attached, but is hosted at AWS and the link to the file is included in the body of the email.

I can use the link with an HTTP get task to pull down the csv file, but the link is unique each day with randomized characters.

I would like to create job to read the body of the email, parse it for the link, store the link in a variable and use that in the http task.

Is there some way to use a task or a trigger to check an email and ready the body so that I can parse it?

I used an email trigger to download the message and store it in a file, but when I open the message file, the body is encoded.
Sponsor
Forum information
Support
2017-06-26T09:25:16Z
It sounds like you should use the Email Trigger. Then you can probably use the Regex method on the body to extract the link. You combine these two Variables:

{REGEX(Match|1111,222,33|\A[0-9]*)}
{TRIGGER(Active|LastTrigger|Mail.Result.Mail.BodyText)}

Into:

{REGEX(Match|{TRIGGER(Active|LastTrigger|Mail.Result.Mail.BodyText)}|\A[0-9]*)}

Now, you only need to replace the regex part to find and extract the email. I am guessing there are a lot of forums for that.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Gary_W
2017-06-26T20:13:18Z
We'll need to see the link to help with a regular expression. Of course alter it if needed for security. if you are able to show the e-mail's body text, that would help as well.
bv749
  •  bv749
  • Paid support Topic Starter
2017-06-27T13:59:27Z
I was able to get this working.

I used a trigger to monitor a mailbox and downloaded the email.
Then I loaded the full text from the .eml file into a variable.
used substring, length, and indexof functions to isolate the BASE64 encoded body of the message.
Decoded the body and loaded the results into a variable.
Then I used the indexof, substring and replace functions to isolate the link from the body of the message.
Then used a HTTP get to pull down the csv file and an SSIS job to load the data into the database.

The trigger seems unstable. If there is any disruption to the connectivity between the visualcron server and the mail server, the trigger will turn itself off.
Justin B
2018-06-27T16:02:39Z
I'm trying to achieve something almost identical. Would you be able to share any more specific details about your solution? Could you provide an example of the functions you're using to isolate the encoded chunk of the .eml and to then identify the hyperlink within the decoded html?

Edit: Just realized VC can decode BASE64 without me needing to leverage a standalone tool. Cool stuff.
Scroll to Top