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 {
1818 } ;
1919 }
2020
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 ;
2724 }
2825
29- dispatchMail ( data , callback ) {
26+ async send ( data ) {
3027 const mailOptions = {
3128 to : data . to ,
3229 subject : data . subject ,
3330 from : this . sendOptions . from ,
3431 html : data . html
3532 } ;
3633
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 ;
4436 }
4537}
4638
You can’t perform that action at this time.
0 commit comments