File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -18,29 +18,21 @@ class Mail {
18
18
} ;
19
19
}
20
20
21
- sendMail ( mailOptions ) {
22
- return new Promise ( ( resolve , reject ) => {
23
- this . client . sendMail ( mailOptions , ( err , info ) => {
24
- resolve ( err , info ) ;
25
- } ) ;
26
- } ) ;
21
+ async sendMail ( mailOptions ) {
22
+ const response = await this . client . sendMail ( mailOptions ) ;
23
+ return response ;
27
24
}
28
25
29
- dispatchMail ( data , callback ) {
26
+ async send ( data ) {
30
27
const mailOptions = {
31
28
to : data . to ,
32
29
subject : data . subject ,
33
30
from : this . sendOptions . from ,
34
31
html : data . html
35
32
} ;
36
33
37
- return this . sendMail ( mailOptions ) . then ( ( err , res ) => {
38
- callback ( err , res ) ;
39
- } ) ;
40
- }
41
-
42
- send ( data , callback ) {
43
- return this . dispatchMail ( data , callback ) ;
34
+ const response = await this . sendMail ( mailOptions ) ;
35
+ return response ;
44
36
}
45
37
}
46
38
You can’t perform that action at this time.
0 commit comments