Repository navigation
Expand file tree
/
Copy pathconfig.js
More file actions
74 lines (63 loc) · 2.14 KB
/
Copy pathconfig.js
File metadata and controls
74 lines (63 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*!
* Copyright (c) 2012-2022 Digital Bazaar, Inc. All rights reserved.
*/
import {config} from '@bedrock/core';
const env = process.env.NODE_ENV;
config.mail = {};
// transport
// can setup in config or at runtime with use('transport', ...);
// supported values:
// null:
// do nothing
// object with any nodemailer transport instance:
// {type: 'transporter', transporter: <transporter>}
// https://nodemailer.com/transports/
// object with SMTP transport:
// {type: 'smtp', options: {...}, verify: <boolean>}
// optionally verify connection on start
// https://nodemailer.com/smtp/
// object with AWS SES transport:
// {type: 'ses', options: {...}}
// https://nodemailer.com/transports/ses/
// object with JSON logging transport:
// output JSON mail structures, useful for debugging
// {type: 'json'}
config.mail.transport = null;
config.mail.templates = {};
// cache templates
// FIXME: some default support already exists
//config.mail.templates.cache = true;
// templates search path, paths checked in order
// defaults to: <appRoot>/emails/
// templates are: <appRoot>/emails/<template>/<part>.ext
config.mail.templates.paths = [];
// default options for all messages
config.mail.message = {};
// default locals for all templates
config.mail.locals = {};
// force mail to field for development use)
// email address string
config.mail.to = null;
// mail preview (for development use)
// boolean
// defaults to true if in development mode
config.mail.preview = env === undefined || env === 'development';
// send mail control
// boolean
// defaults to true if NODE_ENV is 'production'
config.mail.send = env === 'production';
// log emails (for development use)
// defaults to true if in development mode
config.mail.log = {
// log basic headers (from, to, subject, messageId)
headers: env === undefined || env === 'development',
// log text version
text: env === undefined || env === 'development',
// log html version
html: false
};
// subject prefix
// string
// defaults to nothing in 'production' mode, else based on NODE_ENV
config.mail.subjectPrefix =
env === 'production' ? false : `[${(env || 'development').toUpperCase()}] `;