This repository was archived by the owner on Dec 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,23 @@ module.exports = function (options) {
30
30
var locale = args . locality ;
31
31
var code = args . code ;
32
32
if ( options . sendemail && options . email ) {
33
+ logger . warn ( 'email-notifications' , JSON . stringify ( args ) ) ;
33
34
emailCode = code + locale ;
34
35
if ( ! fs . existsSync ( CpTranslations . getEmailTemplatePath ( emailCode ) ) ) emailCode = code + 'en_US' ;
35
36
if ( ! args . to ) return done ( null , { ok : false , why : 'No recipient set.' } ) ;
36
37
37
38
if ( ! bypassTranslation ) {
38
39
subjectTranslation = i18nHelper . getClosestTranslation ( locale , subject ) ;
39
40
if ( subjectTranslation === null ) {
41
+ logger . warn ( 'email-notifications' , JSON . stringify ( {
42
+ ok : false ,
43
+ why : 'Invalid email subject.' ,
44
+ args
45
+ } ) ) ;
40
46
return done ( null , { ok : false , why : 'Invalid email subject.' } ) ;
41
47
}
42
48
subject = subjectTranslation . fetch ( subjectVariables ) ;
43
49
}
44
- logger . warn ( 'email-notifications' , JSON . stringify ( args ) ) ;
45
50
seneca . act ( {
46
51
role : 'mail' , cmd : 'send' ,
47
52
from : args . from || options . sendFrom ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ module.exports = function (args, done) {
17
17
var env = seneca . options ( ) . env ;
18
18
var zenHostname = env . hostname ;
19
19
var protocol = env . protocol ;
20
+ const logger = require ( 'cp-logs-lib' ) ( { name : 'cp-dojos-service' , level : 'warn' } ) . logger ;
20
21
21
22
async . waterfall ( [
22
23
// Set the initial dojo status : awaiting approval
@@ -79,8 +80,10 @@ module.exports = function (args, done) {
79
80
payload : payload } ,
80
81
function ( err , res ) {
81
82
if ( err ) {
83
+ logger . warn ( 'submit-dojo' , err ) ;
82
84
return cb ( err ) ;
83
85
}
86
+ logger . warn ( 'submit-dojo' , res ) ;
84
87
cb ( null , savedDojo ) ;
85
88
} ) ;
86
89
} else {
You can’t perform that action at this time.
0 commit comments