diff --git a/README.md b/README.md index b2acff9..f40cab0 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ email.send({ title: '你好', subtitle: '这是个小标题', desp: '你好,我很可爱', - addressee: '123456@example.com', + address: '123456@example.com', }) // 钉钉机器人。官方文档:https://developers.dingtalk.com/document/app/custom-robot-access diff --git a/src/push/email.ts b/src/push/email.ts index 2235948..2d0a68c 100644 --- a/src/push/email.ts +++ b/src/push/email.ts @@ -26,7 +26,7 @@ type EmailSendOption = { * 收件人邮箱(邮箱地址必须正确) * */ - addressee: string + address: string } /** * 文档:http://doc.berfen.com/1239397 @@ -60,10 +60,10 @@ export class Email implements Send { } async send(option: EmailSendOption): Promise> { - const { title, subtitle, desp, addressee } = option + const { title, subtitle, desp, address } = option Debugger('option: %O', option) - if (!addressee) { - throw new Error('addressee(收件人邮箱) 地址必须正确') + if (!address) { + throw new Error('address(收件人邮箱) 地址必须正确') } const free = 'https://email.berfen.com/api' const pay = `https://email.berfen.com/api/dz/${this.BER_KEY}/` @@ -78,7 +78,7 @@ export class Email implements Send { title, x_title: subtitle, text: desp, - to: addressee, + to: address, }, }) }