mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-14 18:47:32 +01:00
feat: closes #13009, add dedicated test smtp button
which uses the dirty settings on the page add clarification under send test email button add missing lang keys
This commit is contained in:
@@ -14,6 +14,7 @@ const api = require('../../api');
|
||||
const pagination = require('../../pagination');
|
||||
const helpers = require('../helpers');
|
||||
const translator = require('../../translator');
|
||||
const plugins = require('../../plugins');
|
||||
|
||||
const settingsController = module.exports;
|
||||
|
||||
@@ -114,9 +115,14 @@ settingsController.uploads = async (req, res) => {
|
||||
|
||||
settingsController.email = async (req, res) => {
|
||||
const emails = await emailer.getTemplates(meta.config);
|
||||
const hooks = plugins.loadedHooks['static:email.send'];
|
||||
const emailerPlugin = hooks && hooks.length ? hooks[0].id : null;
|
||||
const smtpEnabled = parseInt(meta.config['email:smtpTransport:enabled'], 10) === 1;
|
||||
|
||||
res.render('admin/settings/email', {
|
||||
title: '[[admin/menu:settings/email]]',
|
||||
emailerPlugin,
|
||||
smtpEnabled,
|
||||
emails: emails,
|
||||
sendable: emails.filter(e => !e.path.includes('_plaintext') && !e.path.includes('partials')).map(tpl => tpl.path),
|
||||
services: emailer.listServices(),
|
||||
|
||||
Reference in New Issue
Block a user