fixed account-verification-notification
MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
"The charging station was excluded from this smart charging run automatically."
]
},
- "account-verification-notification": {
+ "account-verification-notification-active": {
"title":"Account Verified",
"buttonText":"E-Mobility",
"text":[
- "Your account has been verified {{accountStatus}} with success!",
- "{{accountStatus2}}"
+ "Your account has been verified and activated with success!"
+ ]
+ },
+ "account-verification-notification-inactive": {
+ "title":"Account Verified",
+ "buttonText":"E-Mobility",
+ "text":[
+ "Your account has been verified with success!",
+ "An administrator will check and activate your account."
]
},
"admin-account-verification-notification": {

MODIFY
src/notification/email/EMailNotificationTask.ts
src/notification/email/EMailNotificationTask.ts
@@ -219,10 +219,17 @@ export default class EMailNotificationTask implements NotificationTask {
public async sendAccountVerificationNotification(data: AccountVerificationNotification, user: User, tenant: Tenant, severity: NotificationSeverity): Promise<void> {
data.buttonUrl = data.evseDashboardURL;
- // TODO - cannot be properly translated
- data.accountStatus = data.userStatus === 'A' ? 'and Activated' : '';
- data.accountStatus2 = data.userStatus === 'I' ? 'An Administrator will check and activate your account' : '';
- return this.prepareAndSendEmail('account-verification-notification', data, user, tenant, severity);
+ let templateName: string ;
+ if (FeatureToggles.isFeatureActive(Feature.NEW_EMAIL_TEMPLATES)) {
+ if (data.userStatus === 'A') {
+ templateName = 'account-verification-notification-active';
+ } else {
+ templateName = 'account-verification-notification-inactive';
+ }
+ } else {
+ templateName = 'account-verification-notification';
+ }
+ return this.prepareAndSendEmail(templateName, data, user, tenant, severity);
}
public async sendAdminAccountVerificationNotification(data: AdminAccountVerificationNotification, user: User, tenant: Tenant, severity: NotificationSeverity): Promise<void> {
@@ -416,7 +423,7 @@ export default class EMailNotificationTask implements NotificationTask {
emailContent = await this.sendStupidEmail(templateName, data, user, tenant, severity);
}
} catch (error) {
- console.log(">>>> " , error);
+ console.log('>>>> ' , error);
await Logging.logError({
tenantID: tenant.id,
siteID: data?.siteID,

MODIFY
src/utils/FeatureToggles.ts
src/utils/FeatureToggles.ts
@@ -10,7 +10,7 @@ export default class FeatureToggles {
// Comment out the features that you want to switch OFF
private static activeFeatures: Feature[] = [
Feature.BILLING_PREVENT_CUSTOMER_DELETION,
- // Feature.NEW_EMAIL_TEMPLATES,
+ Feature.NEW_EMAIL_TEMPLATES,
// Feature.BILLING_SHOW_PRICING_DETAIL,
];

MODIFY
test/api/EmailTest.ts
test/api/EmailTest.ts
@@ -391,7 +391,7 @@ describe('Initialization', () => {
await emailNotificationTask.sendComputeAndApplyChargingProfilesFailed(data,user,tenant,severity);
});
- it('account-verification-notification', async () => {
+ it('account-verification-notification-active', async () => {
const data: AccountVerificationNotification = {
user,
userStatus: UserStatus.ACTIVE,
@@ -400,6 +400,15 @@ describe('Initialization', () => {
await emailNotificationTask.sendAccountVerificationNotification(data,user,tenant,severity);
});
+ it('account-verification-notification-inactive', async () => {
+ const data: AccountVerificationNotification = {
+ user,
+ userStatus: UserStatus.INACTIVE,
+ evseDashboardURL: 'some_url',
+ };
+ await emailNotificationTask.sendAccountVerificationNotification(data,user,tenant,severity);
+ });
+
it('admin-account-verification-notification', async () => {
const data: AdminAccountVerificationNotification = {
user,

fixed account-verification-notification