import { isArray, merge } from 'lodash'
import { createTransport, Transporter } from 'nodemailer'
import { join } from 'path'
+import { root } from '@shared/core-utils'
import { EmailPayload } from '@shared/models'
import { SendEmailDefaultOptions } from '../../shared/models/server/emailer.model'
-import { isTestInstance } from '../helpers/core-utils'
-import { root } from '@shared/core-utils'
+import { isTestOrDevInstance } from '../helpers/core-utils'
import { bunyanLogger, logger } from '../helpers/logger'
import { CONFIG, isEmailEnabled } from '../initializers/config'
import { WEBSERVER } from '../initializers/constants'
this.initialized = true
if (!isEmailEnabled()) {
- if (!isTestInstance()) {
+ if (!isTestOrDevInstance()) {
logger.error('Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!')
}
async sendMail (options: EmailPayload) {
if (!isEmailEnabled()) {
- throw new Error('Cannot send mail because SMTP is not configured.')
+ logger.info('Cannot send mail because SMTP is not configured.')
+ return
}
const fromDisplayName = options.from