Jelajahi Sumber

fix(email-plugin): Relax typings of `handlers` config option

Michael Bromley 3 tahun lalu
induk
melakukan
0dfa9d0b4b

+ 1 - 1
packages/email-plugin/src/dev-mailbox.ts

@@ -44,7 +44,7 @@ export class DevMailbox {
                     await this.handleMockEventFn(handler, {
                         ...handler.mockEvent,
                         ctx: this.createRequestContext(languageCode as LanguageCode),
-                    });
+                    } as EventWithContext);
                     res.send({ success: true });
                 } catch (e) {
                     res.statusCode = 500;

+ 1 - 1
packages/email-plugin/src/types.ts

@@ -50,7 +50,7 @@ export interface EmailPluginOptions {
      * An array of {@link EmailEventHandler}s which define which Vendure events will trigger
      * emails, and how those emails are generated.
      */
-    handlers: EmailEventHandler[];
+    handlers: Array<EmailEventHandler<string, any>>;
     /**
      * @description
      * An object containing variables which are made available to all templates. For example,