Is is possible to send attachments via python?

Posted on
Sun Jul 07, 2019 12:28 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Is is possible to send attachments via python?

Hey Joe,

I haven't seen any references regarding using attachments with your plugin via python. I've sent attachments via the GUI, and it works great, and while creating some sort of trigger and interacting with that is possible, it seems a lot more cumbersome than I expect it should be. Is it currently possible to send an email with an attachment via your plugin and python and, if so, do you have an example of how to do that?

thanx for the plugin, by the way. I use it for triggering action groups as well as providing status to myself and others all the time :-)

Posted on
Sun Jul 07, 2019 12:42 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Is is possible to send attachments via python?

shrxman wrote:
Hey Joe,

I haven't seen any references regarding using attachments with your plugin via python. I've sent attachments via the GUI, and it works great, and while creating some sort of trigger and interacting with that is possible, it seems a lot more cumbersome than I expect it should be. Is it currently possible to send an email with an attachment via your plugin and python and, if so, do you have an example of how to do that?


Just add the other properties as needed. The names of the properties are in the Actions.xml file.

Code: Select all
props = {   
    'emailTo': 'address1, address2',
    'emailCC': 'address3, address4',
    'emailBCC': 'address5, address6',
    'emailSubject': 'Message Subject',
    'emailAttachments': 'file1, file2, file3',
    'emailMessage': 'Message text'
}

bePlugin = indigo.server.getPlugin("com.flyingdiver.indigoplugin.betteremail")
if bePlugin.isEnabled():
    bePlugin.executeAction("sendEmail", deviceId=12345678, props=props)

       

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

Posted on
Sun Jul 07, 2019 3:52 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: Is is possible to send attachments via python?

Awesome! thanx for the quick reply. I'll give that a shot tonight. :-)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests