Announcement

Collapse
No announcement yet.

Sending e-mail macros?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sending e-mail macros?

    When sending an e-mail via an event is there any way to extract the event details via text macros?

    As in, sending e-mails from motion sensors and including the text of the sensor. I'd rather avoid making separate events for all of them if there's a text macro or substitution method for building the subject and message contents.

    #2
    Not unless you get into the realms of storing what triggered that event in replacement variables or virtual devices, then you can use replacement variables in the email body. When a plugin gets an event action (say to send an email) it knows precisely nothing about the event that triggered it and even if it did then it is only possible to get back very limited detail from the event scripting calls.

    Comment


      #3
      Originally posted by wkearney99 View Post
      As in, sending e-mails from motion sensors and including the text of the sensor.
      Can you be a bit more specific about what you mean by "text of the sensor" and "text macros"?

      If you call a script with the event, there is the option to include the subject and/or the message body as a parameter. I have several events that all call the same simple script, but pass it a unique subject to identify which event was responsible. Is that similar to what you want to do?

      Code:
          Public Sub Main(ByVal strSubject As String)
      
              Dim strFrom As String = "xxxxxxxxx@gmail.com"
              Dim strTo1 As String = 
              Dim strTo2 As String = 
              Dim strTo3 As String = 
          Dim strMessage As String = "$time $date"
      
              hs.SendEmail(strTo1, strFrom, "", "", strSubject, strMessage, "")
      
          End Sub
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        Ooops I think I read it wrong, I was thinking you were trying to detect incoming email so ignore me when I said the scripting calls were broken.

        Comment


          #5
          Originally posted by Uncle Michael View Post
          Can you be a bit more specific about what you mean by "text of the sensor" and "text macros"?

          If you call a script with the event, there is the option to include the subject and/or the message body as a parameter. I have several events that all call the same simple script, but pass it a unique subject to identify which event was responsible. Is that similar to what you want to do?
          Yes, that's what I'm after. Being able to use a single script to funnel in the various motion sensor events.

          When I look at setting up an event, where can I pass in the details of what caused the event? I see two fields I can use "Sub or Function" and "Parameters". Are there any 'variables' that can be inserted here? Or if I call a script does it get a 'context' of variables it can query?

          Comment


            #6
            Originally posted by wkearney99 View Post
            Yes, that's what I'm after. Being able to use a single script to funnel in the various motion sensor events.
            When I look at setting up an event, where can I pass in the details of what caused the event?
            I use separate events for each trigger. They all run the same script. Each event includes unique parameters (subject, in my case) that indicate the trigger.
            Mike____________________________________________________________ __________________
            HS3 Pro Edition 3.0.0.548, NUC i3

            HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

            Comment

            Working...
            X