以程式設計方式啟用排程的訊息
使用摘要日期時間項目 $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