mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
fix smtp settings
This commit is contained in:
parent
1a5be46cc6
commit
3d7b0100ff
3 changed files with 1265 additions and 4 deletions
1262
assets/gancio-events.es.js
Normal file
1262
assets/gancio-events.es.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,6 @@ const crypto = require('crypto')
|
|||
const { promisify } = require('util')
|
||||
const sharp = require('sharp')
|
||||
const config = require('../../config')
|
||||
const pkg = require('../../../package.json')
|
||||
const generateKeyPair = promisify(crypto.generateKeyPair)
|
||||
const log = require('../../log')
|
||||
const locales = require('../../../locales/index')
|
||||
|
@ -42,7 +41,7 @@ const defaultSettings = {
|
|||
{ href: '/about', label: 'about' }
|
||||
],
|
||||
admin_email: config.admin_email || '',
|
||||
smtp: config.smtp || false
|
||||
smtp: config.smtp || {}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,7 +184,7 @@ const settingsController = {
|
|||
return sharp(uploadedPath)
|
||||
.resize(400)
|
||||
.png({ quality: 90 })
|
||||
.toFile(baseImgPath + '.png', (err, info) => {
|
||||
.toFile(baseImgPath + '.png', (err) => {
|
||||
if (err) {
|
||||
log.error('[LOGO] ' + err)
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ const locales = require('../../locales')
|
|||
const mail = {
|
||||
send (addresses, template, locals, locale) {
|
||||
locale = locale || settingsController.settings.instance_locale
|
||||
if (process.env.NODE_ENV === 'production' && (!settingsController.settings.admin_email || !settingsController.settings.smtp)) {
|
||||
if (process.env.NODE_ENV === 'production' && (!settingsController.settings.admin_email || !settingsController.settings.smtp || !settingsController.settings.smtp.user)) {
|
||||
log.error(`Cannot send any email: SMTP Email configuration not completed!`)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue