feature toggle - new email
MODIFY
src/notification/email/EMailNotificationTask.ts
src/notification/email/EMailNotificationTask.ts
import { AccountVerificationNotification, AdminAccountVerificationNotification, BillingAccountActivationNotification, BillingAccountCreationLinkNotification, BillingInvoiceSynchronizationFailedNotification, BillingNewInvoiceNotification, BillingUserSynchronizationFailedNotification, CarCatalogSynchronizationFailedNotification, ChargingStationRegisteredNotification, ChargingStationStatusErrorNotification, ComputeAndApplyChargingProfilesFailedNotification, EmailNotificationMessage, EndOfChargeNotification, EndOfSessionNotification, EndOfSignedSessionNotification, EndUserErrorNotification, NewRegisteredUserNotification, NotificationSeverity, OCPIPatchChargingStationsStatusesErrorNotification, OICPPatchChargingStationsErrorNotification, OICPPatchChargingStationsStatusesErrorNotification, OfflineChargingStationNotification, OptimalChargeReachedNotification, PreparingSessionNotStartedNotification, RequestPasswordNotification, SessionNotStartedNotification, TransactionStartedNotification, UnknownUserBadgedNotification, UserAccountInactivityNotification, UserAccountStatusChangedNotification, UserCreatePassword, VerificationEmailNotification } from '../../types/UserNotifications';
+import FeatureToggles, { Feature } from '../../utils/FeatureToggles';
import { Message, SMTPClient, SMTPError } from 'emailjs';
import BackendError from '../../exception/BackendError';
@@ -314,6 +315,13 @@ export default class EMailNotificationTask implements NotificationTask {
message: `No email is provided for User for '${templateName}'`
});
}
+
+
+ if (FeatureToggles.isFeatureActive(Feature.NEW_EMAIL_TEMPLATES)) {
+ // POC from NADER!
+
+ }
+
// Fetch the template
const emailTemplate = await TemplateManager.getInstanceForLocale(user.locale).getTemplate(templateName);
if (!emailTemplate) {

MODIFY
src/utils/FeatureToggles.ts
src/utils/FeatureToggles.ts
export enum Feature {
BILLING_PREVENT_CUSTOMER_DELETION,
BILLING_SHOW_PRICING_DETAIL,
+ NEW_EMAIL_TEMPLATES,
}
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.BILLING_SHOW_PRICING_DETAIL,
];

feature toggle - new email