Send mass message to all users

Last post 08-12-2011, 5:12 PM by piaseee. 11 replies.
Sort Posts: Previous Next
  •  05-09-2011, 3:45 PM 67502

    Send mass message to all users

    Hello,
     
    I am trying to add functionality to the IM, so that and admin can send a message that would go to every single user.  Can anyone please help put me on the right track.
     
    Thank you kindly.
  •  05-09-2011, 9:13 PM 67507 in reply to 67502

    Re: Send mass message to all users

    Hi soyemil,
     
    The code below shows you how to send a message to all online users of CuteMessenger.
     
       CuteChat.ChatPortal portal=CuteChat.AppSystem.Instance.GetCurrentPortal();
                 lock (portal)
                 {
                     if (portal.IsMessengerStarted)
                     {
                         CuteChat.ChatPlaceUser[] users = portal.Messenger.GetAllUsers();
                         foreach (CuteChat.ChatPlaceUser user in users)
                         {
                             portal.Messenger.Manager.PushSTCMessage(user.Connection, ChatMetaData.ServerMsg_SYS_ALERT_MESSAGE, null, "Hello,World!");
                         }
                     }
                 }

     Regards,
     
    ken
  •  05-10-2011, 10:44 AM 67518 in reply to 67507

    Re: Send mass message to all users

    Thank you so much Ken.  Which class do I Inherit in the .vb code in order to make this work?  Please and Thanks
  •  05-10-2011, 10:45 AM 67519 in reply to 67518

    Re: Send mass message to all users

    Is it CuteChat.ChatProvider ?
  •  05-10-2011, 10:48 AM 67520 in reply to 67519

    Re: Send mass message to all users

    Or is it best to create a function in the DNNChatProvider.vb file in the App_Code folder and call that?
  •  05-10-2011, 3:40 PM 67524 in reply to 67520

    Re: Send mass message to all users

    Dear soyemil,
     
    Please follow steps:
    1. Save the following snippet to "DesktopModules/CuteSoft_Client/CuteChat/chatadmin/sendmessage.aspx"
     
    <%@ Register TagPrefix="uc1" TagName="Menu" Src="Menu.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="Banner" Src="Banner.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="LobbyItem" Src="LobbyItem.ascx" %>
    <%@ Page Language="C#" Inherits="CuteChat.ChatAdminPage" %>
    <%@ Import Namespace="CuteChat" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
     <HEAD id="Head1">
      <title>Send Message</title>
      <script runat="server">

    void ButtonAddNew_Click(object sender,EventArgs args)
    {
        CuteChat.ChatPortal portal = CuteChat.AppSystem.Instance.GetCurrentPortal();
        lock (portal)
        {
            if (portal.IsMessengerStarted)
            {
                CuteChat.ChatPlaceUser[] users = portal.Messenger.GetAllUsers();
                foreach (CuteChat.ChatPlaceUser user in users)
                {
                    portal.Messenger.Manager.PushSTCMessage(user.Connection, ChatMetaData.ServerMsg_SYS_ALERT_MESSAGE, null, "Hello,World!");
                }
            }
        }

             
    </script>
      <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
      <link rel="stylesheet" href="style.css">
     </HEAD>
     <body bottommargin="0" topmargin="0" marginheight="0" marginwidth="0">
      <form runat="server" ID="Form2">
       <uc1:Banner id="banner1" runat="server" />
       <table width="840" border="0" cellpadding="3" cellspacing="0">
        <tr>
         <td id="leftcolumn" valign="top">
          <uc1:Menu id="Menu1" runat="server"></uc1:Menu>
         </td>
         <td width="10">&nbsp;</td>
         <td valign="top" align="left" id="content">
         
          <p align="center">
           <asp:Button id="ButtonAddNew" OnClick="ButtonAddNew_Click" runat="server" Text="Send Message"></asp:Button>
          </p>
         </td>
        </tr>
       </table>
       <div id="footer">
        <p><a href="http://cutesoft.net">Copyright 2002-2008 CuteSoft.Net. All rights reserved.</a></p>
       </div>
      </form>
     </body>
    </HTML>

    Please change the highlighted part to your actual path
    3. Click button "Send Message"
    4. Cute Message users will receive message.
     
    Thank you for asking
     
     
  •  05-10-2011, 4:03 PM 67526 in reply to 67524

    Re: Send mass message to all users

    Perfect.  Got it working.  Many many thanks :)
  •  05-10-2011, 4:32 PM 67530 in reply to 67526

    Re: Send mass message to all users

    Sorry to be a bother. I hope my questions will help other people as well.
     
    GetAllUsers() gets all users currently online.  Is there a method for getting even offline users so that when they log in they will get the alert message as well?
  •  05-10-2011, 8:17 PM 67532 in reply to 67530

    Re: Send mass message to all users

    Hi soyemil,
     
    Fow now, only support to send the online message. Sorry for your inconvenience.
     
    Regards,
     
    ken
  •  06-20-2011, 4:47 PM 68051 in reply to 67532

    Re: Send mass message to all users

    Can I use this to send messages to all users ? If so then How ?
    Sticker Printing
    Folder Printing
    Bumper sticker
  •  06-21-2011, 12:48 AM 68059 in reply to 68051

    Re: Send mass message to all users

    Hi mariahayes,
     
    Fow now, only support to send the message to all online users.
     
    Regards,
     
    ken
     
  •  08-12-2011, 5:12 PM 69530 in reply to 67502

    Re: Send mass message to all users

    Hello there, I am new here. I like this forum. I need all your support to contribute myself in this forum. Hope I will get all your support. Thank you so much.

     
     
     
     
     
     
View as RSS news feed in XML