• 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

    Email Title Format

    How-To
    2
    9
    3.1k
    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.
    • G
      georgestefan
      last edited by

      Hello, I'm trying to make a custom email format and I've done almost everything, but I could not find were to modify the title:

      0_1500889359140_Email Title Format.JPG

      I want to remove "Critical" and "id" from there and I didn't find where to make that modification. If can someone help me with that information...

      Thank you!

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

        Hello!

        I think what you're looking for is probably...

        <@subject>Hey - Stuff is happening with the automation system and I think you should know</@subject>

        somewhere in your FTL. For a complete list of subject line options I'll have to refer you to the code a little, as the SubjectDirective class has some parameter options. Aliases override the default (but keep the Critical - and - id portions as you discovered probably), and the last SubjectDirective will probably have the final say.

        https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/email/SubjectDirective.java

        G 1 Reply Last reply Reply Quote 1
        • G
          georgestefan
          last edited by

          Thanks a lot, this works great!

          1 Reply Last reply Reply Quote 0
          • G
            georgestefan @phildunlap
            last edited by georgestefan

            @phildunlap Also I have another question, I don't know if this is possible, I am relative new to mango, for example if I have this email alarm for a compressor, can I display in email last values for Low Pressure and High Pressure?

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

              Glad that did what you were looking for.

              Mongo will probably not give you the right search results, Mango is the name of the software.

              It is not possible in Mango 3.1 but we've added a way to put points into the FTL context in 3.2. I believe releasing that update is not too far away but I can't say for sure.

              In previous versions, the way to achieve this is having the event set a point in the context of a meta point, which computes the whole alarm message you would want with whatever points are in context and then this meta point has a change detector that the email is launched from. Or, you can cut out the first event detector and have the meta point take the source data point as its context, and then have the meta point raise the alarm with relevant other data.

              G 1 Reply Last reply Reply Quote 0
              • G
                georgestefan
                last edited by

                Thanks again!

                1 Reply Last reply Reply Quote 0
                • G
                  georgestefan @phildunlap
                  last edited by

                  @phildunlap Hi again, I have another question about email formatting, I have an event handler which send me an email when a user log in, but the title is a little to complicated but I've seen that the title is generated with some code, it's there a way to have access and modify that?

                  Here is a picture with the title:
                  0_1501171871599_title.JPG

                  and this is the code which generate that title:

                  <@fmt message=evt.message/>
                  
                  1 Reply Last reply Reply Quote 0
                  • phildunlapP
                    phildunlap
                    last edited by phildunlap

                    Hi George,

                    <#assign message><@fmt message=evt.message/></#assign>
                    <@subject>${message?replace("current undesired text", "desired text")}</@subject>
                    

                    You can find other built in methods to manipulate the string, here, http://freemarker.org/docs/ref_builtins_string.html

                    Another possibility is overriding your i18n.properties file. Then you can change the rendered text to whatever you want globally.

                    G 1 Reply Last reply Reply Quote 1
                    • G
                      georgestefan @phildunlap
                      last edited by georgestefan

                      @phildunlap Thanks, I'll try that.

                      I tried and works very well.

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