Send unkown badge notification
MODIFY
src/assets/server/notification/email/en_US/unknown-user-badged.json
src/assets/server/notification/email/en_US/unknown-user-badged.json
"An unknown user has just badged on <b>'<%- chargeBoxID %>'</b> with the badge ID <b>'<%- badgeID %>'</b>."
],
"action": {
- "title": "Edit User",
- "url": "<%- evseDashboardUserURL %>"
+ "title": "Edit Badge",
+ "url": "<%- evseDashboardTagURL %>"
},
"afterActionLines": [
"Best Regards,",

MODIFY
src/assets/server/notification/email/es_MX/unknown-user-badged.json
src/assets/server/notification/email/es_MX/unknown-user-badged.json
"Un usuario desconocido acaba de conectarse a <b> '<% - chargeBoxID%>' </b> con el ID de la insignia <b> '<% - badgeID%>' </b>."
],
"action": {
- "title": "Editar usuario",
- "url": "<%- evseDashboardUserURL %>"
+ "title": "Editar Insignia",
+ "url": "<%- evseDashboardTagURL %>"
},
"afterActionLines": [
"Atentamente,",

MODIFY
src/assets/server/notification/email/fr_FR/unknown-user-badged.json
src/assets/server/notification/email/fr_FR/unknown-user-badged.json
"Un utilisateur inconnu vient juste de badger sur <b>'<%- chargeBoxID %>'</b> avec le badge ID <b>'<%- badgeID %>'</b>."
],
"action": {
- "title": "Editer Utilisateur",
- "url": "<%- evseDashboardUserURL %>"
+ "title": "Editer Badge",
+ "url": "<%- evseDashboardTagURL %>"
},
"afterActionLines": [
"Cordialement,",

MODIFY
src/authorization/Authorizations.ts
src/authorization/Authorizations.ts
@@ -8,6 +8,7 @@ import ChargingStation from '../types/ChargingStation';
import Configuration from '../utils/Configuration';
import Constants from '../utils/Constants';
import Logging from '../utils/Logging';
+import NotificationHandler from '../notification/NotificationHandler';
import { PricingSettingsType } from '../types/Setting';
import { ServerAction } from '../types/Server';
import SessionHashService from '../server/rest/service/SessionHashService';
@@ -733,6 +734,18 @@ export default class Authorizations {
} as Tag;
// Save
await UserStorage.saveTag(tenantID, tag);
+ // Notify (Async)
+ NotificationHandler.sendUnknownUserBadged(
+ tenantID,
+ Utils.generateGUID(),
+ chargingStation,
+ {
+ chargeBoxID: chargingStation.id,
+ badgeID: tagID,
+ evseDashboardURL: Utils.buildEvseURL((await TenantStorage.getTenant(tenantID)).subdomain),
+ evseDashboardTagURL: await Utils.buildEvseTagURL(tenantID, tag)
+ }
+ ).catch(() => { });
// Log
Logging.logWarning({
tenantID: tenantID,

MODIFY
src/integration/pricing/export/convergent-charging/index.ts
src/integration/pricing/export/convergent-charging/index.ts
-export { default } from '../../convergent-charging';
+export { default } from '../../dummy/DummyPricingIntegration';

MODIFY
src/integration/refund/export/concur/index.ts
src/integration/refund/export/concur/index.ts
-export { default } from '../../concur';
+export { default } from '../../dummy/DummyRefundIntegration';

MODIFY
src/integration/smart-charging/export/sap-smart-charging/index.ts
src/integration/smart-charging/export/sap-smart-charging/index.ts
-export { default } from '../../sap-smart-charging';
+export { default } from '../../dummy/DummySmartChargingIntegration';

MODIFY
src/types/UserNotifications.ts
src/types/UserNotifications.ts
@@ -170,7 +170,7 @@ export interface UnknownUserBadgedNotification extends BaseNotification {
chargeBoxID: string;
badgeID: string;
evseDashboardURL: string;
- evseDashboardUserURL: string;
+ evseDashboardTagURL: string;
}
export interface TransactionStartedNotification extends BaseNotification {

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -1049,13 +1049,14 @@ export default class Utils {
}
}
- public static async buildEvseUserURL(tenantID: string, user: User, hash = ''): Promise<string> {
+ public static async buildEvseTagURL(tenantID: string, tag: Tag): Promise<string> {
const tenant = await TenantStorage.getTenant(tenantID);
const _evseBaseURL = Utils.buildEvseURL(tenant.subdomain);
// Add
- return _evseBaseURL + '/users?UserID=' + user.id + hash;
+ return _evseBaseURL + '/users#tag?tagID=' + tag.id;
}
+
public static async buildEvseChargingStationURL(tenantID: string, chargingStation: ChargingStation, hash = ''): Promise<string> {
const tenant = await TenantStorage.getTenant(tenantID);
const _evseBaseURL = Utils.buildEvseURL(tenant.subdomain);

Send unkown badge notification