|
|
@@ -50,7 +50,7 @@ export class EmailEventHandler<T extends string = string, Event extends EventWit
|
|
|
private configurations: EmailTemplateConfig[] = [];
|
|
|
private defaultSubject: string;
|
|
|
private from: string;
|
|
|
- private _mockEvent: Omit<Event, 'ctx'> | undefined;
|
|
|
+ private _mockEvent: Omit<Event, 'ctx' | 'data'> | undefined;
|
|
|
|
|
|
constructor(public listener: EmailEventListener<T>, public event: Type<Event>) {}
|
|
|
|
|
|
@@ -60,7 +60,7 @@ export class EmailEventHandler<T extends string = string, Event extends EventWit
|
|
|
}
|
|
|
|
|
|
/** @internal */
|
|
|
- get mockEvent(): Omit<Event, 'ctx'> | undefined {
|
|
|
+ get mockEvent(): Omit<Event, 'ctx' | 'data'> | undefined {
|
|
|
return this._mockEvent;
|
|
|
}
|
|
|
|
|
|
@@ -213,7 +213,7 @@ export class EmailEventHandler<T extends string = string, Event extends EventWit
|
|
|
* Optionally define a mock Event which is used by the dev mode mailbox app for generating mock emails
|
|
|
* from this handler, which is useful when developing the email templates.
|
|
|
*/
|
|
|
- setMockEvent(event: Omit<Event, 'ctx'>): EmailEventHandler<T, Event> {
|
|
|
+ setMockEvent(event: Omit<Event, 'ctx' | 'data'>): EmailEventHandler<T, Event> {
|
|
|
this._mockEvent = event;
|
|
|
return this;
|
|
|
}
|
|
|
@@ -225,7 +225,7 @@ export class EmailEventHandler<T extends string = string, Event extends EventWit
|
|
|
if (this.configurations.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
- const exactMatch = this.configurations.find((c) => {
|
|
|
+ const exactMatch = this.configurations.find(c => {
|
|
|
return (
|
|
|
(c.channelCode === channelCode || c.channelCode === 'default') &&
|
|
|
c.languageCode === languageCode
|
|
|
@@ -235,7 +235,7 @@ export class EmailEventHandler<T extends string = string, Event extends EventWit
|
|
|
return exactMatch;
|
|
|
}
|
|
|
const channelMatch = this.configurations.find(
|
|
|
- (c) => c.channelCode === channelCode && c.languageCode === 'default',
|
|
|
+ c => c.channelCode === channelCode && c.languageCode === 'default',
|
|
|
);
|
|
|
if (channelMatch) {
|
|
|
return channelMatch;
|