diff --git a/Alert/nodemon.json b/Alert/nodemon.json index 6b311043f2..7492d3da34 100644 --- a/Alert/nodemon.json +++ b/Alert/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer", "../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/CommonServer/Services/StatusPageSubscriberService.ts b/CommonServer/Services/StatusPageSubscriberService.ts index acbece357e..cf9b5f2c69 100644 --- a/CommonServer/Services/StatusPageSubscriberService.ts +++ b/CommonServer/Services/StatusPageSubscriberService.ts @@ -9,7 +9,7 @@ import EmailTemplateType from 'Common/Types/Email/EmailTemplateType'; import StatusPageDomainService from './StatusPageDomainService'; import { LIMIT_PER_PROJECT } from 'Common/Types/Database/LimitMax'; import URL from 'Common/Types/API/URL'; -import { Domain, HttpProtocol } from '../Config'; +import { Domain, FileRoute, HttpProtocol } from '../Config'; import logger from '../Utils/Logger'; import StatusPage from 'Model/Models/StatusPage'; import StatusPageDomain from 'Model/Models/StatusPageDomain'; @@ -71,6 +71,7 @@ export class Service extends DatabaseService { pageTitle: true, name: true, isPublicStatusPage: true, + logoFileId: true }, props: { isRoot: true, @@ -143,6 +144,8 @@ export class Service extends DatabaseService { templateType: EmailTemplateType.SubscribedToStatusPage, vars: { statusPageName: statusPageName, + logoUrl: onCreate.carryForward.logoFileId ? new URL(HttpProtocol, Domain).addRoute(FileRoute).addRoute("/image/"+onCreate.carryForward.logoFileId) + .toString() : '', statusPageUrl: statusPageURL, isPublicStatusPage: onCreate.carryForward.isPublicStatusPage ? "true" : "false", diff --git a/DashboardAPI/nodemon.json b/DashboardAPI/nodemon.json index 2885214620..d6570eb5d6 100644 --- a/DashboardAPI/nodemon.json +++ b/DashboardAPI/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer", "../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/File/nodemon.json b/File/nodemon.json index d11ad6ba91..b2ad8daecd 100644 --- a/File/nodemon.json +++ b/File/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./", "../Common", "../CommonServer", "../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/HelmChart/nodemon.json b/HelmChart/nodemon.json index 40e70fe1f4..5ca66ad778 100644 --- a/HelmChart/nodemon.json +++ b/HelmChart/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/HttpTestServer/nodemon.json b/HttpTestServer/nodemon.json index 6e14bb8c03..ddc616534c 100644 --- a/HttpTestServer/nodemon.json +++ b/HttpTestServer/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer","../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/Identity/nodemon.json b/Identity/nodemon.json index 6b311043f2..7492d3da34 100644 --- a/Identity/nodemon.json +++ b/Identity/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer", "../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/Integration/nodemon.json b/Integration/nodemon.json index 6b311043f2..7492d3da34 100644 --- a/Integration/nodemon.json +++ b/Integration/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer", "../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/Licensing/nodemon.json b/Licensing/nodemon.json index 6b311043f2..7492d3da34 100644 --- a/Licensing/nodemon.json +++ b/Licensing/nodemon.json @@ -1,5 +1,5 @@ { "watch": ["./","../Common", "../CommonServer", "../Model"], - "ext": "ts,json,tsx,env,js,jsx", + "ext": "ts,json,tsx,env,js,jsx,hbs", "exec": "node --inspect=0.0.0.0:9229 --require ts-node/register Index.ts" } \ No newline at end of file diff --git a/Mail/Services/MailService.ts b/Mail/Services/MailService.ts index e3028f28e3..c86ce8b237 100755 --- a/Mail/Services/MailService.ts +++ b/Mail/Services/MailService.ts @@ -14,6 +14,25 @@ import Hostname from 'Common/Types/API/Hostname'; import Port from 'Common/Types/Port'; import { JSONObject } from 'Common/Types/JSON'; import logger from 'CommonServer/Utils/Logger'; +import { IsDevelopment } from 'CommonServer/Config'; + +Handlebars.registerHelper('ifCond', function (v1, v2, options) { + if (v1 === v2) { + //@ts-ignore + return options.fn(this); + } + //@ts-ignore + return options.inverse(this); +}); + +Handlebars.registerHelper('ifNotCond', function (v1, v2, options) { + if (v1 != v2) { + //@ts-ignore + return options.fn(this); + } + //@ts-ignore + return options.inverse(this); +}); export default class MailService { public static isSMTPConfigValid(obj: JSONObject): boolean { @@ -30,8 +49,8 @@ export default class MailService { if (!Email.isValid(obj['SMTP_EMAIL'].toString())) { logger.error( 'SMTP_EMAIL env var ' + - obj['SMTP_EMAIL'] + - ' is not a valid email' + obj['SMTP_EMAIL'] + + ' is not a valid email' ); return false; } @@ -105,7 +124,7 @@ export default class MailService { // Localcache templates, so we dont read from disk all the time. let templateData: string; - if (LocalCache.hasValue('email-templates', emailTemplateType)) { + if (LocalCache.hasValue('email-templates', emailTemplateType) && !IsDevelopment) { templateData = LocalCache.getString( 'email-templates', emailTemplateType diff --git a/Mail/Templates/SubscribedToStatusPage.hbs b/Mail/Templates/SubscribedToStatusPage.hbs index f04a9fe9e3..bac31808b0 100644 --- a/Mail/Templates/SubscribedToStatusPage.hbs +++ b/Mail/Templates/SubscribedToStatusPage.hbs @@ -265,16 +265,18 @@ width="64">
+ {{#ifNotCond logoUrl ""}}
OneUptime + src="{{logoUrl}}">
+ {{/ifNotCond}}
@@ -366,7 +368,7 @@ - {{#if isPublicStatusPage}} + {{#ifCond isPublicStatusPage "true"}} @@ -396,7 +398,7 @@
- {{/if}} + {{/ifCond}} @@ -410,7 +412,7 @@ - +
- You can unsubscribe at any time by viisting this link: {{unsubscribeUrl}} + You can unsubscribe at any time by clicking here.
- - - Thanks, have a great day. - - - @@ -458,38 +453,7 @@
- - - - - - - - - - - -
-
-
- - - OneUptime Team. - - - -
-
-
-
- + @@ -527,13 +491,6 @@ width="64">
-