Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions openapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"hash": "2284d91996d1b44f5934a851eca1543a146010d858b454e067536ecad05b5515",
"hash": "784097a775e52168883b76a7f9a709a61104d472edba7731896d3f0369068f3f",
"openapi": "3.0.0",
"paths": {
"/hello": {
Expand Down Expand Up @@ -1013,7 +1013,7 @@
"name": "from",
"required": false,
"in": "query",
"description": "发件者",
"description": "发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`",
"schema": {
"type": "string"
}
Expand Down Expand Up @@ -1146,7 +1146,7 @@
"name": "from",
"required": false,
"in": "query",
"description": "发件者",
"description": "发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`",
"schema": {
"type": "string"
}
Expand Down Expand Up @@ -6672,7 +6672,8 @@
"type": "object",
"properties": {
"from": {
"type": "string"
"type": "string",
"description": "发件人地址,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`"
},
"to": {
"type": "string"
Expand Down Expand Up @@ -6715,7 +6716,7 @@
},
"from": {
"type": "string",
"description": "发件者"
"description": "发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`"
},
"to": {
"type": "string",
Expand Down Expand Up @@ -6756,7 +6757,7 @@
},
"from": {
"type": "string",
"description": "发件者"
"description": "发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`"
},
"to": {
"type": "string",
Expand Down Expand Up @@ -6820,7 +6821,7 @@
},
"from": {
"type": "string",
"description": "发件者"
"description": "发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`"
},
"to": {
"type": "string",
Expand Down Expand Up @@ -8610,7 +8611,7 @@
},
"from": {
"type": "string",
"description": "发件者"
"description": "发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `\"robot\" <[email protected]>`"
},
"to": {
"type": "string",
Expand Down
5 changes: 4 additions & 1 deletion src/email/dto/send-email.dto.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';

export class SendEmailDto {
/**
* 发件人地址,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `"robot" <[email protected]>`
*/
@IsNotEmpty()
@IsEmail()
@IsEmail({ allow_display_name: true })
from: string;

@IsNotEmpty()
Expand Down
4 changes: 2 additions & 2 deletions src/email/entities/email-record.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export enum EmailStatus {
@SortFields(['sentAt'])
export class EmailRecordDoc {
/**
* 发件者
* 发件者,支持纯邮箱或带显示名格式,例如 `[email protected]` 或 `"robot" <[email protected]>`
*/
@IsNotEmpty()
@IsEmail()
@IsEmail({ allow_display_name: true })
@Prop()
from: string;

Expand Down
Loading