Email notifications for Group

You can share your Lua Scripts with everybody here.

Email notifications for Group

Postby impact » Wed Jun 18, 2014 3:55 pm

Hello,

we'd live to configure notification emails for Group instead of account.

Now we have configured something like this

if ("%Name" == "test") then
c_SendMail("test@test.it","text","text","","smtp")
end

Is it possible to substitute account name (%Name) with group?
Which is the syntax for Group name?

I tried with %Group and %GroupName but it didn't work
impact
 
19
 
Fri May 10, 2013 1:39 pm

Re: Email notifications for Group

Postby impact » Mon Jun 30, 2014 7:20 am

Anyone???
impact
 
19
 
Fri May 10, 2013 1:39 pm

Re: Email notifications for Group

Postby FTP » Fri Jul 04, 2014 6:05 am

OK, here is an example, finding the first group, and send email for the first group, anyway, you can modify the following Lua script for your own requirement:


Code: Select all
do
        local user = c_GetUser("%Domain", %Name)
        local grouplist = user["usergroups"] 
       
        for _,tempgroup in pairs(grouplist) do
      local groupname= tempgroup["groupname"]
                if groupname == "CUSTOMERS" then
         c_SendMail("test111@test.it","text","text","","smtp")
                        break
      elseif groupname == "BOSS" then
         c_SendMail("test222@test.it","text","text","","smtp")
                        break
                end
   end
end
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am

Re: Email notifications for Group

Postby seattle » Thu Sep 13, 2018 12:13 am

anyone have something like this working with version 5.0.9 ?
seattle
 
19
 
Tue Nov 07, 2017 7:31 pm

Re: Email notifications for Group

Postby FTP » Thu Sep 13, 2018 12:40 pm

seattle wrote:anyone have something like this working with version 5.0.9 ?


I think it can work for the recent versions, any problem?
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron