How to mail users according user group using workflow script.
Here is a sample code to mail users from “TDAdmin” group
Dim uCnt, header, body, custUsers, usr, UList
set td = TDConnection
Set custUsers = td.Customization.Users
Set UList = custUsers.Users
header= "Defect ID:" & Bug_Fields("BG_BUG_ID").Value & " - Changed to priority : " & Bug_Fields("BG_PRIORITY").Value
body= "Defect Summary : " & Bug_Fields("BG_SUMMARY").Value
msgbox UList.Count
For Each usr In UList
uCnt = uCnt + 1
With usr
if usr.InGroup("TDAdmin") then
msgbox "Mailing " & .name & ", " & .Email
td.SendMail .Email ,"admin","Summary","body",NULL,"HTML"
end if
End With
Next
Here is a sample code to mail users from “TDAdmin” group
Dim uCnt, header, body, custUsers, usr, UList
set td = TDConnection
Set custUsers = td.Customization.Users
Set UList = custUsers.Users
header= "Defect ID:" & Bug_Fields("BG_BUG_ID").Value & " - Changed to priority : " & Bug_Fields("BG_PRIORITY").Value
body= "Defect Summary : " & Bug_Fields("BG_SUMMARY").Value
msgbox UList.Count
For Each usr In UList
uCnt = uCnt + 1
With usr
if usr.InGroup("TDAdmin") then
msgbox "Mailing " & .name & ", " & .Email
td.SendMail .Email ,"admin","Summary","body",NULL,"HTML"
end if
End With
Next
0 comments:
Post a Comment