File tree 2 files changed +4
-4
lines changed 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ const sendEmail = async (templateId, message) => { // send email
56
56
const sgSpan = await logger . startSpan ( 'sendgrid' ) ;
57
57
const result = await sgMail . send ( msg )
58
58
await logger . endSpan ( sgSpan ) ;
59
- logger . info ( `Email sent successfully with result: ${ JSON . stringify ( result ) } ` ) ;
59
+ logger . info ( `Email sent successfully with result: ${ JSON . stringify ( result ) } \n ${ JSON . stringify ( msg ) } ` ) ;
60
60
return result
61
61
} catch ( err ) {
62
62
logger . error ( `Error occurred in sendgrid api calling: ${ err } ` ) ;
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ async function dataHandler(consumer, handlers) {
70
70
recipients : JSON . stringify ( messageJSON . recipients ) ,
71
71
}
72
72
73
- await emailModel . create ( emailInfo )
73
+ const emailObj = await emailModel . create ( emailInfo )
74
74
const result = await handler ( topicName , messageJSON ) ;
75
75
76
76
logger . info ( 'info' , 'Email sent' , {
@@ -83,8 +83,8 @@ async function dataHandler(consumer, handlers) {
83
83
const emailTries = { }
84
84
if ( result . success ) {
85
85
emailTries [ topicName ] = 0 ;
86
- emailModel . status = 'SUCCESS' ;
87
- await emailModel . save ( ) ;
86
+ emailObj . status = 'SUCCESS' ;
87
+ await emailObj . save ( ) ;
88
88
} else {
89
89
// emailTries[topicName] += 1; //temporary disabling this feature
90
90
if ( result . error ) {
You can’t perform that action at this time.
0 commit comments