-
Notifications
You must be signed in to change notification settings - Fork 53
Script: GetRecipients
Samuel Plentz edited this page Jul 26, 2022
·
1 revision
Get recipients of the mail in a list. (similar to what [[TO=fullname]]
and [[TO=email]]
returns)
let result = "";
let toRow = this.mWindow.document.getElementById("addressRowTo");
let toAddresses = toRow.getElementsByAttribute("emailAddress", "*");
for(let toAddress of toAddresses) {
result += "To: " + toAddress.getAttribute("label") + "\r\n";
}
let ccRow = this.mWindow.document.getElementById("addressRowCc");
let ccAddresses = ccRow.getElementsByAttribute("emailAddress", "*");
for(let ccAddress of ccAddresses) {
result += "CC: " + ccAddress.getAttribute("label") + "\r\n";
}
let bccRow = this.mWindow.document.getElementById("addressRowBcc");
let bccAddresses = bccRow.getElementsByAttribute("emailAddress", "*");
for(let bccAddress of bccAddresses) {
result += "BCC: " + bccAddress.getAttribute("label") + "\r\n";
}
let replyToRow = this.mWindow.document.getElementById("addressRowReply");
let replyToAddresses = replyToRow.getElementsByAttribute("emailAddress", "*");
for(let replyToAddress of replyToAddresses) {
result += "Reply to: " + replyToAddress.getAttribute("label") + "\r\n";
}
return result;
Get recipient list:
[[SCRIPT=GetRecipients]]
Returns:
To: John Doe <[email protected]>
To: Jane Doe <[email protected]>
CC: [email protected]
BCC: [email protected]
Reply to: Test <[email protected]>