mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-19 04:57:54 +01:00
just use emailLogo instead of doing logo with x50.png suffix
This commit is contained in:
@@ -150,12 +150,15 @@ function uploadImage(filename, folder, uploadedFile, req, res, next) {
|
||||
// Post-processing for site-logo
|
||||
if (path.basename(filename, path.extname(filename)) === 'site-logo' && folder === 'system') {
|
||||
var uploadPath = path.join(nconf.get('upload_path'), folder, 'site-logo-x50.png');
|
||||
image.resizeImage({
|
||||
path: uploadedFile.path,
|
||||
target: uploadPath,
|
||||
extension: 'png',
|
||||
height: 50,
|
||||
}, function (err) {
|
||||
async.series([
|
||||
async.apply(image.resizeImage, {
|
||||
path: uploadedFile.path,
|
||||
target: uploadPath,
|
||||
extension: 'png',
|
||||
height: 50,
|
||||
}),
|
||||
async.apply(meta.configs.set, 'brand:emailLogo', path.join(nconf.get('upload_url'), 'system/site-logo-x50.png'))
|
||||
], function (err) {
|
||||
next(err, imageData);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -32,10 +32,8 @@ Emailer.registerApp = function (expressApp) {
|
||||
app = expressApp;
|
||||
|
||||
var logo = null;
|
||||
if (meta.configs.hasOwnProperty('brand:emailLogo')) {
|
||||
logo = nconf.get('url') + meta.configs['brand:emailLogo'];
|
||||
} else if (meta.config.hasOwnProperty('brand:logo')) {
|
||||
logo = nconf.get('url') + meta.config['brand:logo'].replace('.png', '-x50.png');
|
||||
if (meta.config.hasOwnProperty('brand:emailLogo')) {
|
||||
logo = nconf.get('url') + meta.config['brand:emailLogo'];
|
||||
}
|
||||
|
||||
Emailer._defaultPayload = {
|
||||
@@ -67,6 +65,7 @@ Emailer.registerApp = function (expressApp) {
|
||||
// Update default payload if new logo is uploaded
|
||||
pubsub.on('config:update', function (config) {
|
||||
if (config) {
|
||||
Emailer._defaultPayload.logo.src = config['brand:emailLogo'];
|
||||
Emailer._defaultPayload.logo.height = config['brand:emailLogo:height'];
|
||||
Emailer._defaultPayload.logo.width = config['brand:emailLogo:width'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user