Skip to content

Commit a321840

Browse files
🤖 Merge PR DefinitelyTyped#74228 nodemailer: Fix 'From' header incorrect array-less typing by @SpeedyCraftah
1 parent 53fd3f0 commit a321840

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎types/nodemailer/lib/mailer/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ declare namespace Mail {
9797

9898
interface Options {
9999
/** The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name <sender@server.com>' */
100-
from?: string | Address | undefined;
100+
from?: string | Address | Array<string | Address> | undefined;
101101
/** An e-mail address that will appear on the Sender: field */
102102
sender?: string | Address | undefined;
103103
/** Comma separated list or an array of recipients e-mail addresses that will appear on the To: field */

‎types/nodemailer/nodemailer-tests.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ function message_common_fields_test() {
120120
};
121121
}
122122

123+
// Array variant of common fields
124+
125+
function message_common_fields_array_test() {
126+
const message: Mail.Options = {
127+
from: ["sender@server.com", { address: "sender2@server.com", name: "Sender2" }],
128+
to: ["receiver@sender.com", { address: "receiver2@sender.com", name: "Receiver2" }],
129+
cc: ["ccdreceiver@sender.com"],
130+
bcc: ["bccdreceiver@sender.com"],
131+
};
132+
}
133+
123134
// More advanced fields
124135

125136
function message_more_advanced_fields_test() {

0 commit comments

Comments
 (0)