Send Message from Admin by Plugin

Hi,

I am new in Wildfire and tried to write and setup a new plugin in admin page to let admin send messages to all or selected groups.

Our system works base on Active Directory users, so admin selects users from these groups.

My plugin starts and by system.print, I can check and see that user group work (shows me some users like username@server) and then make message to send to them by sessionManager.broadcast(newMessage);

, but nothing receive in client parts.

Would you please let me know the steps to write codes for only send message from Admin. Should I register a component to be able to send message? Do you know any tutorial documents for these steps? I read wildfire documents some times and checked Java.Doc for wildfire APIs as well.

Some parts of my plugin codes are as bellow:

Message message = new Message();

message.setBody(theBody);

message.setSubject(“A message from admin”);

for (JID userJID : gg.getMembers())

{

Message newMessage = message.createCopy();

newMessage.setTo(userJID);

try {

sessionManager.broadcast(newMessage);

}

catch (Exception e) {

componentManager.getLog().error(e);

}

Thanks

see Send Message from Admin by Plugin