SOLVED: Access email contents

Posted on
Mon Jun 29, 2020 9:39 am
ryanbuckner offline
Posts: 1075
Joined: Oct 08, 2011
Location: Northern Virginia

SOLVED: Access email contents

This feature request is to optionally capture the contents of the scanned email either in a variable or postgres DB.

Use Case:

Email gets scanned and contains information about whether school is closed or government is closed and an action group executes to trigger the right Indigo house mode.
Last edited by ryanbuckner on Sun May 16, 2021 3:54 pm, edited 1 time in total.

Posted on
Mon Jun 29, 2020 9:42 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Access email contents

Use Better Email plugin. The message contents are stored in the device state, and you can use a trigger to do whatever you want with it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jun 29, 2020 9:49 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Access email contents

+1

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 29, 2020 10:57 am
ryanbuckner offline
Posts: 1075
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Access email contents

FlyingDiver wrote:
Use Better Email plugin. The message contents are stored in the device state, and you can use a trigger to do whatever you want with it.


I'll give it a shot

Posted on
Sat Jul 04, 2020 10:14 am
ryanbuckner offline
Posts: 1075
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Access email contents

ryanbuckner wrote:
FlyingDiver wrote:
Use Better Email plugin. The message contents are stored in the device state, and you can use a trigger to do whatever you want with it.


I'll give it a shot


This solution worked great. Here's what I was able to do:

1) Step 1 - Better Email scans the email and triggers when the "from" field matches
2) The trigger runs a quick python script to extract a URL and push it to an Indigo variable
3) Another trigger sees the variable change and launches a python script that visits the URL from the variable (email) to complete a daily survey

This saves me lots of compliance issues because I have a survey I must submit each morning. The URL changes every day but my results are always the same.

Posted on
Sat Jul 04, 2020 10:33 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Access email contents

ryanbuckner wrote:
This solution worked great. Here's what I was able to do:

1) Step 1 - Better Email scans the email and triggers when the "from" field matches
2) The trigger runs a quick python script to extract a URL and push it to an Indigo variable
3) Another trigger sees the variable change and launches a python script that visits the URL from the variable (email) to complete a daily survey

This saves me lots of compliance issues because I have a survey I must submit each morning. The URL changes every day but my results are always the same.


Excellent.

Though I do wonder why you're doing that with two different scripts, rather than all in one script. Unless there's a reason you need to save the URL in the variable?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jul 04, 2020 10:58 am
ryanbuckner offline
Posts: 1075
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Access email contents

to save it for rerun in case it fails

Posted on
Sat Jul 04, 2020 10:59 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Access email contents

ryanbuckner wrote:
to save it for rerun in case it fails


Ah. Good point.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests