PublicAPI.Portal.Messages.SendMessageДокументация ELMA API
Отправить сообщение пользователю
 
 
Синтаксис

public void SendMessage(
	string messageSubject,
	string messageText,
	IEnumerable<User> recipientList,
	IEnumerable<InformationChannel> channelList,
	User messageAuthor,
	IEnumerable<Attachment> attachmentList,
	IEnumerable<DocumentAttachment> documentAttachmentList
)

Параметры

messageSubject
Тип: System String
Тема сообщения
messageText
Тип: System String
Текст сообщения
recipientList
Тип: System.Collections.Generic IEnumerable User 
Получатель. Объект. Путь доступа: PublicAPI.Portal.Security.User
channelList
Тип: System.Collections.Generic IEnumerable InformationChannel 
Каналы. Объект. Путь доступа: PublicAPI.Portal.Objects.Messages.InformationChannel
messageAuthor
Тип: User
Автор сообщения. Объект. Путь доступа: PublicAPI.Portal.Security.User
attachmentList
Тип: System.Collections.Generic IEnumerable Attachment 
Вложения. Объект. Путь доступа: PublicAPI.Portal.Objects.Common.Attachment
documentAttachmentList
Тип: System.Collections.Generic IEnumerable DocumentAttachment 
Вложения документов. Объект. Путь доступа: PublicAPI.Docflow.Objects.DocumentAttachment
Примеры

//загружаем пользователей по идентификаторам и добавляем в список получателей 
var recipientList = new List<IUser>();
recipientList.Add(PublicAPI.Portal.Security.User.Load(3));
recipientList.Add(PublicAPI.Portal.Security.User.Load(4));
//загружаем автора сообщения 
var messageAuthor = PublicAPI.Portal.Security.User.Load(5);
//создаем вложения (ссылка на создание вложений находится в конце статьи) 
var attachments = context.Attachments;
//создаем пустой список информационных каналов 
var channelList = new List<IInformationChannel>();
//загружаем инфоканалы по идентифифкаторам и добавляем их в список
channelList.Add(PublicAPI.Portal.Objects.Messages.InformationChannel.Load(3));
channelList.Add(PublicAPI.Portal.Objects.Messages.InformationChannel.Load(4));
//тема сообщения 
var messageSubject = "Тема сообщения";
//текст сообщения 
var messageText = "Текст сообщения";
//вложения документов 
var documentAttachments = context.DocumentAttachments;


//отправляем сообщение
PublicAPI.Portal.Messages.SendMessage(messageSubject, messageText, recipientList, channelList, messageAuthor, attachments, documentAttachments);
См. также