DRAFT - troubleshooting outlook rendering issues
MODIFY
src/assets/email/mjml-components/email_header.mjml
src/assets/email/mjml-components/email_header.mjml
<mj-section padding-top="40px">
<mj-column width="40%">
- <mj-image href="{{evseDashboardURL}}" src="{{tenantLogoURL}}"></mj-image>
+ <mj-image href="{{infoIcon}}" src="{{infoIcon}}"></mj-image>
+ </mj-column>
+</mj-section>
+<mj-section>
+ <mj-column>
+ <mj-text color="#ffffff" font-size="12px">{{infoIcon}}</mj-text>
+ <mj-text color="#ffffff" font-size="12px">{{evseDashboardURL}}</mj-text>
+ </mj-column>
+</mj-section>
+<mj-section padding-top="40px">
+ <mj-column width="40%">
+ <mj-image href="{{tenantLogoURL}}" src="{{tenantLogoURL}}"></mj-image>
</mj-column>
</mj-section>
<mj-section>
<mj-column>
<mj-text color="#ffffff" font-size="12px">{{tenantName}}</mj-text>
+ <mj-text color="#ffffff" font-size="12px">{{tenantLogoURL}}</mj-text>
+ </mj-column>
+</mj-section>
+<mj-section padding-top="40px">
+ <mj-column width="40%">
+ <mj-image href="{{staticLogo}}" src="{{staticLogo}}"></mj-image>
+ </mj-column>
+</mj-section>
+<mj-section>
+ <mj-column>
+ <mj-text color="#ffffff" font-size="12px">{{staticLogo}}</mj-text>
</mj-column>
</mj-section>

MODIFY
src/assets/storage/schemas/configuration/configuration-save.json
src/assets/storage/schemas/configuration/configuration-save.json
"disableBackup": {
"type": "boolean"
},
+ "troubleshootingMode": {
+ "type": "boolean"
+ },
"smtp": {
"type": "object",
"properties": {

MODIFY
src/notification/email/EMailNotificationTask.ts
src/notification/email/EMailNotificationTask.ts
@@ -296,8 +296,11 @@ export default class EMailNotificationTask implements NotificationTask {
content: email.html // Only log the email content when running automated tests
}
});
+ if (!this.emailConfig.troubleshootingMode) {
+ // Do not send emails when in dev mode or while running automated tests
return ;
}
+ }
try {
// Get the SMTP client
const smtpClient = this.getSMTPClient(useSmtpClientBackup);
@@ -414,7 +417,7 @@ export default class EMailNotificationTask implements NotificationTask {
});
}
// Enrich the sourceData with constant values
- await this.enrichSourceData(tenant, sourceData);
+ this.enrichSourceData(tenant, sourceData);
// Build the context with recipient data
const context: Record<string, unknown> = this.populateNotificationContext(tenant, recipient, sourceData);
// Send the email
@@ -440,16 +443,19 @@ export default class EMailNotificationTask implements NotificationTask {
}
}
- private async enrichSourceData(tenant: Tenant, sourceData: any): Promise<void> {
+ private enrichSourceData(tenant: Tenant, sourceData: any): void {
// Branding Information
sourceData.openEMobilityPoweredByLogo = BrandingConstants.OPEN_EMOBILITY_POWERED_BY,
sourceData.openEmobilityWebSiteURL = BrandingConstants.OPEN_EMOBILITY_WEBSITE_URL;
// Tenant information
sourceData.tenantName = (tenant.id === Constants.DEFAULT_TENANT_ID) ? Constants.DEFAULT_TENANT_ID : tenant.name;
- if (!sourceData.tenantLogoURL) {
// Perf optimization - do it only once to avoid too many calls to getTenantLogo()
- sourceData.tenantLogoURL = await this.getTenantLogo(tenant);
+ if (!sourceData.tenantLogoURL) {
+ // sourceData.tenantLogoURL = await this.getTenantLogo(tenant); // logo - base64 encoded are not shown in most of the email clients (such as outlook)
+ sourceData.tenantLogoURL = `${Utils.buildRestServerURL()}/v1/util/tenants/logo?ID=${tenant.id}`;
}
+ sourceData.infoIcon = `${Utils.buildEvseURL()}/assets/img/info.png`;
+ sourceData.staticLogo = 'https://open-e-mobility.io/wp-content/uploads/2022/09/OEM_degrade_name-200x150.png';
}
private populateNotificationContext(tenant: Tenant, recipient: User, sourceData: any): any {

MODIFY
src/types/configuration/EmailConfiguration.ts
src/types/configuration/EmailConfiguration.ts
@@ -9,6 +9,7 @@ export default interface EmailConfiguration {
password: string;
};
disableBackup?: boolean;
+ troubleshootingMode?: boolean
smtpBackup?: {
from: string;
host: string;

DRAFT - troubleshooting outlook rendering issues