public void SendMessage( string messageSubject, string messageText, IEnumerable<User> recipientList, IEnumerable<InformationChannel> channelList, User messageAuthor, IEnumerable<Attachment> attachmentList, IEnumerable<DocumentAttachment> documentAttachmentList )
Send a message to the user
Syntax
public void SendMessage( string messageSubject, string messageText, IEnumerable<User> recipientList, IEnumerable<InformationChannel> channelList, User messageAuthor, IEnumerable<Attachment> attachmentList, IEnumerable<DocumentAttachment> documentAttachmentList )
Parameters
- messageSubject
- Type: System String
Message subject
- messageText
- Type: System String
Message text
- recipientList
- Type: System.Collections.Generic IEnumerable User
Recipient. Object. Access path: PublicAPI.Portal.Security.User
- channelList
- Type: System.Collections.Generic IEnumerable InformationChannel
Channels. Object. Access path: PublicAPI.Portal.Objects.Messages.InformationChannel
- messageAuthor
- Type: User
Message author. Object. Access path: PublicAPI.Portal.Security.User
- attachmentList
- Type: System.Collections.Generic IEnumerable Attachment
Attachments. Object. Access path: PublicAPI.Portal.Objects.Common.Attachment
- documentAttachmentList
- Type: System.Collections.Generic IEnumerable DocumentAttachment
Documents attachments. Object. Access path: PublicAPI.Docflow.Objects.DocumentAttachment
Examples
//load the list of users by IDs and add them to the list of recipients var recipientList = new List<IUser>(); recipientList.Add(PublicAPI.Portal.Security.User.Load(3)); recipientList.Add(PublicAPI.Portal.Security.User.Load(4)); //load the message author var messageAuthor = PublicAPI.Portal.Security.User.Load(5); //create attachments (a link to creating attachments is in the end of the article) var attachments = context.Attachments; //create an empty list of information channels var channelList = new List<IInformationChannel>(); //load infochannels by IDs and add them to the list channelList.Add(PublicAPI.Portal.Objects.Messages.InformationChannel.Load(3)); channelList.Add(PublicAPI.Portal.Objects.Messages.InformationChannel.Load(4)); //message subject var messageSubject = "Message subject"; //message text var messageText = "Message text"; //document attachments var documentAttachments = context.DocumentAttachments; //send the message PublicAPI.Portal.Messages.SendMessage(messageSubject, messageText, recipientList, channelList, messageAuthor, attachments, documentAttachments);
See Also