fix(core): update
This commit is contained in:
36
ts/mta/mta.classes.email.ts
Normal file
36
ts/mta/mta.classes.email.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export interface IAttachment {
|
||||
filename: string;
|
||||
content: Buffer;
|
||||
contentType: string;
|
||||
}
|
||||
|
||||
export interface IEmailOptions {
|
||||
from: string;
|
||||
to: string;
|
||||
subject: string;
|
||||
text: string;
|
||||
attachments: IAttachment[];
|
||||
mightBeSpam?: boolean;
|
||||
}
|
||||
|
||||
export class Email {
|
||||
from: string;
|
||||
to: string;
|
||||
subject: string;
|
||||
text: string;
|
||||
attachments: IAttachment[];
|
||||
mightBeSpam: boolean;
|
||||
|
||||
constructor(options: IEmailOptions) {
|
||||
this.from = options.from;
|
||||
this.to = options.to;
|
||||
this.subject = options.subject;
|
||||
this.text = options.text;
|
||||
this.attachments = options.attachments;
|
||||
this.mightBeSpam = options.mightBeSpam || false;
|
||||
}
|
||||
|
||||
public getFromDomain() {
|
||||
return this.from.split('@')[1]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user