-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(email-plugin): Provide an Injector instance to .loadData function
BREAKING CHANGE: If you are using the `.loadData()` method of an EmailEventHandler, the callback signature has changed to provide an instance of the Injector class, rather than an `inject()` function.
- Loading branch information
1 parent
e1fe622
commit e2665a7
Showing
3 changed files
with
11 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -367,8 +367,8 @@ describe('EmailPlugin', () => { | |
it('loads async data', async () => { | ||
const handler = new EmailEventListener('test') | ||
.on(MockEvent) | ||
.loadData(async ({ inject }) => { | ||
const service = inject(MockService); | ||
.loadData(async ({ injector }) => { | ||
const service = injector.get(MockService); | ||
return service.someAsyncMethod(); | ||
}) | ||
.setFrom('"test from" <[email protected]>') | ||
|
@@ -398,8 +398,8 @@ describe('EmailPlugin', () => { | |
.setFrom('"test from" <[email protected]>') | ||
.setSubject('Hello, {{ testData }}!') | ||
.setRecipient(() => '[email protected]') | ||
.loadData(async ({ inject }) => { | ||
const service = inject(MockService); | ||
.loadData(async ({ injector }) => { | ||
const service = injector.get(MockService); | ||
return service.someAsyncMethod(); | ||
}) | ||
.setTemplateVars(event => ({ testData: event.data })); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters