Better Email plugin (Beta) Discussion

Posted on
Mon Jun 22, 2015 4:02 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Better Email plugin (Beta) Discussion

The limitations in email handling in Indigo finally annoyed me enough to do something about it. This plugin allows creation of three devices, each representing an email type server. There's one for IMAP servers, one for POP servers, and one for SMTP servers. The IMAP and POP devices have triggers for email received. There's several states exposed for this, but if you want to use both subject and message body in your conditionals, trigger on the "lastMessage" state as it's the last one updated. I would use Conditionals to look for specific strings in the state fields rather than trying to do an exact match in the Trigger.

The SMTP device allows you to set up a specific email server/account to send mail "From". It has one action available, which sends an email. The advantage here is that you can define multiple SMTP devices, with different SMTP credentials and different "From" addresses. Also, variable substitution is enabled in the message subject and body.

Error handling is still pretty spotty, and you'll probably need to run it in debug mode all the time to get any useful feedback on it.

https://dl.dropboxusercontent.com/u/7563539/Better%20Email-0.0.3.indigoPlugin.zip

Feedback in this thread please.

joe

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

Posted on
Mon Jun 22, 2015 4:18 pm
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Better Email plugin (Beta)

LOL - necessity is the mother of invention! Thanks for the contribution. Once you're out of beta, I highly recommend that you add it to the Contribution Library since dropbox/other download links have a tendency to go stale after a while.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jun 22, 2015 4:27 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: Better Email plugin (Beta)

Fantastic!

I use Find My Friends to do presence tracking for two members of my house and the apple Mail app has been extremely unreliable over the last few weeks. This looks like it might solve my problem! I'll give it a shot soon and let you know how it goes.

Posted on
Mon Jun 22, 2015 6:43 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

New version posted above. Stupid error in SMTP device.

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

Posted on
Tue Jun 23, 2015 7:06 pm
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: Better Email plugin (Beta)

Hi Joe,

This is great – thanks for the contribution!

Image

Posted on
Tue Jun 23, 2015 7:42 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Plugin is scriptable:

Code: Select all
betterEmail = "com.flyingdiver.indigoplugin.betteremail"
bePlugin = indigo.server.getPlugin(betterEmail)
if bePlugin.isEnabled():
   bePlugin.executeAction("sendEmail", deviceId=XXXXXXX,
       props={'emailTo':'someone@server.domain', 'emailSubject':'Subject, of course', 'emailMessage':'Put something interesting here.'})

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

Posted on
Wed Jun 24, 2015 6:55 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Better Email plugin (Beta)

Enjoying the plugin - thank you!

I do have a dumb question: How do you use the message substitution in the subject field?

JP

Posted on
Wed Jun 24, 2015 7:18 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

roquej wrote:
Enjoying the plugin - thank you!

I do have a dumb question: How do you use the message substitution in the subject field?

JP


Syntax is %%v:XXXX%% to substitute in the value of a variable, or %%d:XXX:stateName%% for a state value of a device.

For instance, if you're doing a security alert, use a server action to set a variable to the name of the zone. If the ID number of the variable is 12345678, then the Subject might be:

"Security Alert for zone: %%v:12345678%%".

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

Posted on
Wed Jun 24, 2015 7:19 pm
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Better Email plugin (Beta)

Thank you

Posted on
Wed Jun 24, 2015 7:19 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Right now I'm working on code to queue up any outgoing email message so that if the server isn't responding or there's some other configuration issue, they'll stay queued until it gets fixed. I'm also adding an action to clear the queue.

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

Posted on
Thu Jun 25, 2015 12:50 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: Better Email plugin (Beta)

Way cool idea.... Welcome to the world of developing :P

Mike

Posted on
Thu Jun 25, 2015 12:54 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Chameleon wrote:
Way cool idea.... Welcome to the world of developing :P

Mike


I've been a software developer for over 30 years. This is just my first Indigo plugin. ;)

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

Posted on
Sat Jun 27, 2015 7:46 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Better Email plugin (Beta)

Very cool. Any chance of extending it to include iMessage notifications?


Sent from my iPad using Tapatalk

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Sat Jun 27, 2015 7:51 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Bollar wrote:
Very cool. Any chance of extending it to include iMessage notifications?


That would have to be a totally separate Plugin. Can't you do iMessage notifications with the Growl plugin?

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

Posted on
Sat Jun 27, 2015 10:56 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Better Email plugin (Beta)

I can do iMessage notifications with a short AppleScript, but your plugin is more powerful and easier.


Sent from my iPad using Tapatalk

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Who is online

Users browsing this forum: No registered users and 2 guests