Examples: Fields that control mailing options
An editable SendTo field with a default value
You want to give users the name of the mail-in Employee Survey database, and the option of mailing surveys to other people. Create an editable SendTo field, select "Allow multi-values," and write a default value formula that includes the mail-in database name, enclosed in quotation marks.
A hidden SendTo field with a single recipient
Sandy Brown needs to receive all documents saved in the Marketing Statistics database. Add a hidden Names field called SendTo to the Statistics form. The field formula contains the recipient's name and domain enclosed in quotation marks. The recipient's domain is required if the recipient isn't in the same Domino® domain from which the document is sent.
"Sandy Brown @ Marketing"
A formula that calculates recipients and sends a document
Approvers want to receive new travel requests from employees by e-mail. On the Travel Request form of the Employee Expenses database, create hidden text fields called SendTo, Subject, and Remark. The following field formula example calculates the names of approvers and sends the original document as a link when the document is saved for the first time.
REM "Send mail to approvers the first time the doc is saved";
REM;
SendTo :=@Unique(@Trim(ApproverName_1 : ApproverName_2 : ApproverName_3));
Subject := "Travel Request for " + TravelerName + "requires your approval";
Remark := "A Travel Request has been entered for " + TravelerName + ". Your approval is required. Please double-click the following link and approve or reject the request.";
REM;
@If(@IsNewDoc & @IsDocBeingSaved; @MailSend(SendTo; ""; ""; Subject; Remark; "";[IncludeDoclink]); "")