Base solution for your next web application
Open Closed

Per Tenant Email Account Setting #4545


User avatar
0
ultimatemm created

Hi,

What I learned and understood from AspNetZero is Host email setting will be handled all tenants and host email operations. Is there anyway whether I can enable or reference the code to implement Per Tenant Email setting? Eg. <a href="mailto:[email protected]">[email protected]</a>,[email protected] and <a href="mailto:[email protected]">[email protected]</a> something like this. :)


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @ultimatemm, you mean STMP settings, right ? If so, you need to change SMTP settings scopes to Tenant, see <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Setting-Management#setting-scope">https://aspnetboilerplate.com/Pages/Doc ... ting-scope</a>.

    Should be something like this in GetSettingDefinitions method of AppSettingProvider.

    context.Manager.GetSettingDefinition(EmailSettingNames.Smtp.UserName).Scopes = SettingScopes.Tenant;
    

    You also need to do this for all EmailSettingNames.Smtp.* values.

    You also need to create a SMTP settings tab on tenant settings page which should insert/update smtp settings for tenant scope. Then, when you try to retrieve SMTP settings, it will be retrieved just like you want.

  • User Avatar
    0
    vladsd created

    I believe there is more, as backend needs to save into tenant storage. For example:

    await SettingManager.ChangeSettingForTenantAsync(AbpSession.GetTenantId(),AppSettings.TenantManagement.BillingLegalName, input.LegalName);
    

    vs

    await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.DefaultFromAddress, input.DefaultFromAddress);
    

    sounds like a great feature to have

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @vladsd. You can always create feature requests by creating issues here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues">https://github.com/aspnetzero/aspnet-zero-core/issues</a>. In that way, the team will easily consider your request and assign it to a milestone if necessary.

  • User Avatar
    0
    vladsd created

    I already did. There are a lot of good features in your framework that can be uncovered with a few lines of code.

  • User Avatar
    0
    alper created
    Support Team

    thanks for your feedback