Author Topic: How do I put time and date into an email message sent by rule execution?  (Read 2734 times)

LakeHouse

  • Newbie
  • *
  • Posts: 5
    • View Profile
I'm creating some rules to email me when alarm points trip. I would like to embed the date and time into the email message. Are there system variables that contain that data? How are the values expressed in the email message?

iostream212

  • Sr. Member
  • ****
  • Posts: 459
    • View Profile
Re: How do I put time and date into an email message sent by rule execution?
« Reply #1 on: November 17, 2012, 11:54:08 pm »
This can be done easily using scripts. If you are unsure how to script something what I like to do is use the script builder and then convert the statement into a script once done. The scripting data type DateTime has a Now() function that gets the current DateTime. Below is an example script to send an email from the device EmailSender with a dynamic timestamp.
Code: [Select]
EmailSender.SendEmail("RecipientEmail@Domain.Com", "Date Time Test", "This was sent at " + DateTime.Now.ToString());

Happy scripting.
Sent from my Galaxy Nexus using Tapatalk 2
« Last Edit: November 17, 2012, 11:57:28 pm by iostream212 »
I always wanted to be somebody. In retrospect, I think I should have been more specific.