IScheduledTaskProperties.MailRecipients

Syntax

MailRecipients: IArrayList;

Description

The MailRecipients property determines the emails collection, which are used to sent notifications of task completion.

Comments

The collection can contain the following values:

The MailTargetType property must be specified in settings if the repository users are added to the collection.

Example

Executing the example requires that the repository contains a scheduled tasks container with the TASK_CONTAINER identifier. At least one task is created in the container.

Sub UserProc;
Var
    MB: IMetabase;
    Cont: IScheduledTasksContainer;
    Task: IScheduledTask;
    Props: IScheduledTaskProperties;
    Mails: IArrayList;
Begin
    MB := MetabaseClass.Active;
    Cont := MB.ItemById("TASK_CONTAINER").Bind As IScheduledTasksContainer;
    Task := Cont.Tasks.Item(0).Edit As IScheduledTask;
    Props := Task.Properties;
    Mails := Props.MailRecipients;
    //Fixed email
    Mails.Add("User@Example.ru");
    //Email mentioned in user profile
    Mails.Add(MB.LogonSession.User);
    Props.MailTargetType := ScheduledTaskMailTarget.Personal Or ScheduledTaskMailTarget.Work;
    Props.MailRecipients := Mails;
    (Task As IMetabaseObject).Save;
End Sub UserProc;

On executing the example the settings of the first task, created in the container, are changed. Email addresses to which an example execution report is to be sent are specified in the task settings.

See also:

IScheduledTaskProperties