メッセージのスケジュールをプログラムで有効にする
メッセージのスケジュールを有効にするには、サマリー日時項目 $SendAt
を使用します。
このタスクについて
- 例: ボタン式をスケジュールする
-
_def := @If(@IsAvailable($SendAt); $SendAt; @Now); _newValue := @Prompt([OkCancelEdit]; "Schedule delivery"; "Enter date and time this message should be sent"; @Text(_def)); REM {If user cancels, execution stops.}; _newValue := @TextToTime(_newValue); _valid := @If(!@IsTime(_newValue); @False; @Text(@Time(_newValue)) != "" & @Text(@Date(_newValue)) != ""); @If(!_valid; @Prompt([Ok]; "Schedule delivery"; "Please supply a date and time."); _newValue > @Now; FIELD $SendAt := _newValue; FIELD $SendAt := @DeleteField);
- 例: API
-
項目名は、SDK の以下に #define に続けて指定できます。
stdnames.h
#define MAIL_SENDAFTER_ITEM "$SendAt" /* Scheduled mail date and time specified */
- 例: LotusScript®
-
%REM Sub SendDelayedNotice Description: Send a specified user an email scheduled for delivery at 8AM tomorrow morning, with a reminder to review a specified document at that time. Arguments: recipient: email address of recipient. linkDoc: the document they are to review. %END REM Sub SendDelayedNotice(ByVal recipient As String, linkDoc As NotesDocument) Dim ses As New NotesSession, db As NotesDatabase, memo As NotesDocument, body As NotesRichTextItem Dim sendTime As Variant Set db = ses.CurrentDatabase Set memo = db.CreateDocument Call memo.ReplaceItemValue("Form", "Memo") Call memo.ReplaceItemValue("Subject", "Document review reminder") sendTime = Today + (4./3.) ' 8am tomorrow morning (in the current TZ) Call memo.ReplaceItemValue("$SendAt", sendTime) Set body = memo.CreateRichTextItem("Body") Call body.Appendtext("Good morning! It's time to review this document: ") Call body.Appenddoclink(linkDoc, "", "") body.Update Call memo.Send(False, recipient) End Sub