Commit 8122bc7 1 parent 912154e commit 8122bc7 Copy full SHA for 8122bc7
File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
//file should be placed in countly/extend
2
2
//edit this script and put it in countly/extend/mail.js to overwrite existing email templates and settings
3
3
var nodemailer = require ( 'nodemailer' ) ;
4
-
4
+ const pluginManager = require ( '../plugins/pluginManager.js' ) ;
5
+ const plugins = pluginManager . getPlugins ( ) ;
5
6
//rename company
6
7
var company = "Company" ;
7
8
8
9
10
+ if ( plugins . indexOf ( 'white-labeling' ) > - 1 ) {
11
+ try {
12
+ const pluginsConfig = pluginManager . getConfig ( "white-labeling" ) ;
13
+ const { emailFrom, emailCompany} = pluginsConfig ;
14
+ email = emailFrom && emailFrom . length > 0 ? emailFrom : email ;
15
+ company = emailCompany && emailCompany . length > 0 ? emailCompany : company ;
16
+ }
17
+ catch ( error ) {
18
+ console . log ( 'Error getting plugins config' , error ) ;
19
+ }
20
+ }
21
+
22
+
9
23
module . exports = function ( mail ) {
10
24
//define this if you need to send email from some third party service
11
25
mail . smtpTransport = nodemailer . createTransport ( {
You can’t perform that action at this time.
0 commit comments