• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Request for info: Email templates for data points notifications

    User help
    3
    11
    2.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • richard.mortimerR
      richard.mortimer
      last edited by

      Hi,

      I'm new to Mango and the forums (so if my terminology is wrong, apologies in advance). I've been asked to create some email templates on specific events happening with our Mango ES devices, and I've followed the basic bouncing ball from this page: https://help.infiniteautomation.com/custom-email-templates - however I'm unclear how I can send a 'test' version of the email to make sure it looks ok, is there a more advanced video or webpage on the topic?

      I've also been looking through the FTL page here: https://freemarker.apache.org/docs/dgui_template_exp.html - are there any "cheat sheets" which refer to the MangoES devices, or are these device specific?

      Thanks, all the best

      Richard

      1 Reply Last reply Reply Quote 0
      • CraigWebC
        CraigWeb
        last edited by

        Hi Richard

        Welcome to mango automation. A send email now button would be quiet convenient, I do agree. I think the best workaround to test your template would be to create a binary virtual point that is settable and add a change event to it, then for testing purposes add your event handler to this point. You can then just toggle the point to send your email.

        Freemarker can be quite a lot to take in. But if you are familiar with HTML it shouldn't be too hard to figure things out. What are you struggling with? The layout or inserting the data where you want it?

        richard.mortimerR 1 Reply Last reply Reply Quote 0
        • richard.mortimerR
          richard.mortimer @CraigWeb
          last edited by richard.mortimer

          @craigweb said in Request for info: Email templates for data points notifications:

          Welcome to mango automation. A send email now button would be quiet convenient, I do agree. I think the best workaround to test your template would be to create a binary virtual point that is settable and add a change event to it, then for testing purposes add your event handler to this point. You can then just toggle the point to send your email.

          Thanks for the welcome - as I mentioned I'm quite new to Mango, so are there any documents or videos you can point me to which would help me to set a binary point?

          Freemarker can be quite a lot to take in. But if you are familiar with HTML it shouldn't be too hard to figure things out. What are you struggling with? The layout or inserting the data where you want it?

          At the moment I'm just using the template as laid out on the page in the first post, which reads like:

          <@subject>Hey - Stuff is happening with the automation system and I think you should know</@subject>
          <#if renderedHtmlPointValues??>
            <#list renderedHtmlPointValues as renderedPvt>
            ${additionalContext.temperature.deviceName} - ${additionalContext.temperature.name} - ${renderedPvt.value} - ${renderedPvt.time}<br/>
            </#list>
          </#if>
          

          But without being able to send the email, I can't see the output and that's where I'm kinda stuck ...

          Cheers

          Richard

          1 Reply Last reply Reply Quote 0
          • CraigWebC
            CraigWeb
            last edited by

            If a point is settable then you can go to the data point details page and search for that point. You will be able to set it there.
            0_1554287066443_untitled (2).png

            1 Reply Last reply Reply Quote 0
            • richard.mortimerR
              richard.mortimer
              last edited by richard.mortimer

              Thanks, I was able to set up a data point, and managed to get it working (in the old interface):

              0_1554365952906_data_points_richard.jpg

              I was able to gather this information from the data point into an email:

              0_1554366124569_data_points_richard2.jpg

              Can I get the information from a second data point into my table ... ? (for example using the ${p1234.value} syntax? I couldn't quite figure it out .... )

              Or data from the tags ...

              Thanks

              Richard

              richard.mortimerR 1 Reply Last reply Reply Quote 0
              • phildunlapP
                phildunlap
                last edited by

                Hi Richard,

                Does this thread answer your question? https://forum.infiniteautomation.com/topic/3989/send-multiple-point-value-in-alarm-text

                richard.mortimerR 1 Reply Last reply Reply Quote 0
                • richard.mortimerR
                  richard.mortimer @phildunlap
                  last edited by

                  @phildunlap said in Request for info: Email templates for data points notifications:

                  Does this thread answer your question? https://forum.infiniteautomation.com/topic/3989/send-multiple-point-value-in-alarm-text

                  Wow - thanks for that ... there's a lot to take in, so I'm going to go through it thoroughly. I was able to get some data about a secondary data point, but they appeared to be 'static' values rather than 'data' values, and I suspect that thread will explain the 'why' of that.

                  Is it possible to also access the 'tags' of the data point - as per the picture below:

                  0_1554427056893_data_tags.jpg

                  Thanks for all your help so far!!

                  Richard

                  richard.mortimerR 1 Reply Last reply Reply Quote 0
                  • richard.mortimerR
                    richard.mortimer @richard.mortimer
                    last edited by

                    @richard-mortimer said in Request for info: Email templates for data points notifications:

                    Can I get the information from a second data point into my table ... ? (for example using the ${p1234.value} syntax? I couldn't quite figure it out .... )

                    For anyone following the syntax is ${additionalContext.p1234.deviceName} for static values ...

                    Cheers

                    1 Reply Last reply Reply Quote 0
                    • phildunlapP
                      phildunlap
                      last edited by phildunlap

                      Can I get the information from a second data point into my table ... ? (for example using the ${p1234.value} syntax? I couldn't quite figure it out .... )

                      Not quite. The EmailHandlerRT (see https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/rt/event/handlers/EmailHandlerRT.java#L333 ) puts the points into the FTL model as an EmailPointWrapper (defined at the bottom EmailHandlerRT, extending DataPointWrapper: https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/rt/script/DataPointWrapper.java ) which has a list of values, but not the current value (beyond being in the list of latest values if logged, the runtime portion of the data point wrapper is null).

                      The thread I linked to has iterations over a <#list> of values, for additionalContext.p1234.rawValues and additionalContext.p1234.values

                      1 Reply Last reply Reply Quote 0
                      • richard.mortimerR
                        richard.mortimer @richard.mortimer
                        last edited by

                        @richard-mortimer said in Request for info: Email templates for data points notifications:

                        Is it possible to also access the 'tags' of the data point - as per the picture below:

                        0_1554427056893_data_tags.jpg

                        In the interest of future people reading this post, it is done via ${point.tags.Test_Tag} and ${point.tags.ABC} for my example above. You need to address the correct tag name.

                        Cheers

                        Richard

                        1 Reply Last reply Reply Quote 0
                        • phildunlapP
                          phildunlap
                          last edited by

                          Thanks for having an eye to posterity!

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post