LogicMachine Forum
Filter tags for differentiated EMAIL and SMS sending - Printable Version

+- LogicMachine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Filter tags for differentiated EMAIL and SMS sending (/showthread.php?tid=6437)



Filter tags for differentiated EMAIL and SMS sending - Frank68 - 22.05.2026

Hi 
I would like to try to differentiate between sending emails and text messages based on the tags in the subject that triggers the alarm.

Code:
    for i, tag in ipairs(tags) do
      if tag == 'MEC' then
        -- ASSEGNO LISTA MAIL DA UTILIZZARE
            iddest = emailsMAN
      elseif tag == 'ELE' then
            iddest = emailsVIS2
        -- COMPILARE LISTA MAIL PER CUI ALLARME E ATTIVO
      elseif tag == 'TEC' then
            iddest = emailsALL
        -- COMPILARE LISTA MAIL PER CUI ALLARME E ATTIVO
      elseif tag == 'ALL' then
            iddest = emailsALL
        -- COMPILARE LISTA MAIL PER CUI ALLARME E ATTIVO    
      else
        -- COMPILARE LISTA MAIL PER CUI ALLARME E ATTIVO   
      end
    end    
    
        -- verificare indirizzi a cui mandare mail
        emails = {}
        
      -- verifico indirizzi per MAIL
            if (grp.getvalue('32/1/29') == true) then
              maddr= grp.getvalue('32/1/1')
I was thinking of using this code, but I don't know how to pass the group to the email address. I wanted to know if there was a way to assign TAGS to the email address, then compare the matches, add them to the address list, and finally check the various lists. If the length is >0, send emails to the lists, sending for all the lists.

Could this be a solution?

Thank you very much.


RE: Filter tags for differentiated EMAIL and SMS sending - Daniel - 22.05.2026

I'm not really sure what is the task here but run this and see if this helps you. 
Code:
log(grp.gettags(event.dst))