Replies: 2 comments 1 reply
-
Never mind it looks like I am misinterpreting the documentation based on #6264 The documentation does make you think though that you can do this via appsettings.json but it appears you can not. |
Beta Was this translation helpful? Give feedback.
0 replies
-
No worries, you can include them in appsettings, but you'd have to bind
them (I argued with Zoltan about including this in the docs a bit, because
it confuses the hell out of people they way he wrote it)
What you want to do is use PostConfigureOptions and bind the options value
from the app settings you made.
so inject IShellConfiguration and then run
PostConfigureOptions<SmtpSettings>(_shellConfiguration[SmtpSettings])
(roughly)
or pass a lambda PostConfigure<SmtpSettings>( o =>
{
o.Password = _shellConfiguration.GetSection("SmtpSettings:Password")
}
Generally requires debugging, I can never remember the right accessor for
GetSection
D
…On Sat, Aug 28, 2021 at 7:53 AM Seth Cleaver ***@***.***> wrote:
Never mind it looks like I am misinterpreting the documentation based on
#6264 <#6264>
The documentation does make you think though that you can do this via
appsettings.json but it appears you can not.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10176 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJE5F5ZPCQJSGZV3PXCBTLT7CIWHANCNFSM5C63K7OQ>
.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, according to the documentation here: https://docs.orchardcore.net/en/latest/docs/reference/core/Configuration/#ioptions-configuration
I should be able to configure the smtpsettings in the appsettings.json like so but this doesn't seem to work.
Logic dictates that I should also then be able to set the password in App Service configuration like
OrchardCore__SmtpSettings__Password
- this doesn't seem to work either.Outcome I am looking for - I want to default these settings for all tenants.
Beta Was this translation helpful? Give feedback.
All reactions