Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Sending messages between users to their respective message centerSending messages between users to their respective message center
Previous
 
Next
New Post
1/12/2014 7:43 PM
 

Hi,

I'm implementing a new feature in my website DNN Platform 7.1, with a simple textbox and button trying to send a message into other users's Message Center inbox. This is the code I'm using after investigate:

Dim inboxMessage As New DotNetNuke.Services.Messaging.Data.Message()
            inboxMessage.FromUserID = UserId ' <--- User who send the message
     inboxMessage.ToUserID = UserTo  ' <--- User who receive the message 
            inboxMessage.PortalID = PortalId
            inboxMessage.Subject = "Message from another user"
            inboxMessage.Body = txtMensaje.Text

            inboxMessage.EmailSent = False
            inboxMessage.AllowReply = True
            inboxMessage.Status = DotNetNuke.Services.Messaging.Data.MessageStatusType.Unread
            inboxMessage.MessageDate = DateTime.Now
            Dim dnnMessaging As New DotNetNuke.Services.Messaging.Data.MessagingDataService()
            Dim result As Long = dnnMessaging.SaveMessage(inboxMessage)
            dnnMessaging.UpdateMessage(inboxMessage)

This code works and looks like it inserts a line in the DNN database, into the Messaging_Messages table, but the Messaging Center uses the CoreMessaging_Messages table so the messages I send with this code are never shown into the users's inbox.

Anyone have a point about it?

Thanks in advance


dotNet ES
Owner, Josep Morell
http://www.dotnetes.com
DNN System Integration Company
 
New Post
1/12/2014 11:11 PM
 

The DotNetNuke.Services.Messaging namespace and its classes and methods (particularly the DotNetNuke.Services.Messaging.MessagingController) were deprecated in DNN 6.2.0. You should be using those classes and methods in the DotNetNuke.Services.Social.Messaging namespace which will place sent messages in the CoreMessaging_Messages table.

There is a brief section in the DNN Wiki (6.2.0 Developer Quickstart) on using the Core Messaging API but the best way to see how the API is used is to download the appropriate version of the DNN Platform Source Package.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/15/2014 6:40 AM
 

Thanks William for your information.

After read tons of documentation, dowload the source code version and have dived between the modules and scripts that use the Social Messaging API, I put the final code in case another user needs to do the same job:

DotNetNuke.Services.Social.Messaging.Message message = new Message();
List<UserInfo> users = new List<DotNetNuke.Entities.Users.UserInfo>();
users.Add(UserController.GetUserById(INTEGER, INTEGER));
message.Body = STRING;
message.Subject = STRING;
MessagingController.Instance.SendMessage(message, null, users, null, this.UserInfo);


dotNet ES
Owner, Josep Morell
http://www.dotnetes.com
DNN System Integration Company
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Sending messages between users to their respective message centerSending messages between users to their respective message center


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out