Re: Send mass message to all users

  •  05-10-2011, 3:40 PM

    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
     
     
View Complete Thread