Skip to content

Commit 04c77b6

Browse files
Add warning about AddEmailing() registration scope.
1 parent c6546e9 commit 04c77b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Emailing/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ services.AddEmailing(options =>
131131
});
132132
```
133133

134+
> **Important:**
135+
> The `AddEmailing()` method registers a scoped implementation of `IEmailManager`.
136+
> This is required because email templates (for example Razor-based templates) may depend on scoped services
137+
> that are tied to the currently authenticated user.
138+
> As a consequence, every service that depends on `IEmailManager` must also be registered with a scoped lifetime.
139+
134140
The `AddEmailing()` method returns an `EmailingBuilder` that can be used to continue configuring the emailing infrastructure
135141
(for example, provider registration in other packages).
136142

0 commit comments

Comments
 (0)