Better Email plugin (Beta) Discussion

User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Better Email plugin (Beta) Discussion

Post by FlyingDiver »

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/756 ... Plugin.zip

Feedback in this thread please.

joe
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Better Email plugin (Beta)

Post by jay (support) »

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
User avatar
SpencerJRoberts
Posts: 256
Joined: Sun Dec 09, 2012 12:07 pm
Location: Mountain View, CA

Re: Better Email plugin (Beta)

Post by SpencerJRoberts »

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.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Post by FlyingDiver »

New version posted above. Stupid error in SMTP device.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Better Email plugin (Beta)

Post by matt (support) »

Hi Joe,

This is great – thanks for the contribution!
Image
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Post by FlyingDiver »

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':'[email protected]', 'emailSubject':'Subject, of course', 'emailMessage':'Put something interesting here.'})
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
roquej
Posts: 628
Joined: Sun Jan 04, 2015 4:56 pm
Location: South Florida, USA

Re: Better Email plugin (Beta)

Post by roquej »

Enjoying the plugin - thank you!

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

JP
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Post by FlyingDiver »

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
User avatar
roquej
Posts: 628
Joined: Sun Jan 04, 2015 4:56 pm
Location: South Florida, USA

Re: Better Email plugin (Beta)

Post by roquej »

Thank you
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Post by FlyingDiver »

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
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Better Email plugin (Beta)

Post by Chameleon »

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

Mike
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Post by FlyingDiver »

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
Bollar
Posts: 528
Joined: Sun Aug 11, 2013 3:14 pm

Re: Better Email plugin (Beta)

Post by Bollar »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email plugin (Beta)

Post by FlyingDiver »

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
Bollar
Posts: 528
Joined: Sun Aug 11, 2013 3:14 pm

Re: Better Email plugin (Beta)

Post by Bollar »

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
Locked

Return to “Better Email”