Time in e-mail

Posted on
Thu Mar 05, 2015 4:25 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Time in e-mail

Hi all,

I have some triggers which send e-mail.
Would it be possible to insert in the e-mail the current time (i.e. the time when the trigger was fired).

Thanks
Marco

Posted on
Thu Mar 05, 2015 4:55 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Time in e-mail

If you are using the "Send Notification Email" action, then I don't think so. Something like this should work for you in an embedded script (tested):

Code: Select all
time = indigo.server.getTime()
emailAddress = "me@me.com"
emailBody = (u'This is the body of the email. It can contain lots of information if you wish.  For example, the current time is: %s' % time)

indigo.server.sendEmailTo(emailAddress, subject="Email subject text goes here", body=emailBody)

Of course, you must have Indigo's email feature enabled, but it sounds like you have already done that.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Mar 05, 2015 5:03 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Time in e-mail

Yes, Indigo can send e-mail already and so far I used the server action.

I will switch to embedded script :)

Thanks a lot

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests