This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Filter tags for differentiated EMAIL and SMS sending
#1
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.
Reply
#2
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))
------------------------------
Ctrl+F5
Reply


Forum Jump: