That is a built-in module in ABP. I think I found the reason. You must execute:
options.UseAutofac();
internal class Program { private static async Task Main(string[] args) { using var app = await AbpApplicationFactory.CreateAsync<AbpEmailingModule>();
await app.InitializeAsync();
var settingProvider = app.ServiceProvider.GetRequiredService<ISettingProvider>();
var test = await settingProvider.GetOrNullAsync(EmailSettingNames.DefaultFromAddress);
}
}
Unhandled exception. Volo.Abp.AbpException: Undefined setting: Abp.Mailing.DefaultFromAddress at Volo.Abp.Settings.SettingDefinitionManager.GetAsync(String name) at Volo.Abp.Settings.SettingProvider.GetOrNullAsync(String name) at TwAbp.Emailing.Surenotify.ConsoleTest.Program.Main(String[] args) in /Users/rex/Documents/surenotify-emailing/TwAbp.Emailing.Surenotify/TwAbp.Emailing.Surenotify.ConsoleTest/Program.cs:line 19 at TwAbp.Emailing.Surenotify.ConsoleTest.Program.<Main>(String[] args)
Process finished with exit code 134.
I would like to ask, if I have implemented both MailKit and another similar email sending module, how can I allow tenants to choose one of them to send emails through configuration?
I’m heading in the same direction as well. Thank you for your response.
We didn’t see the part where “Payment module will support getting the current tenant URL.” Our tenant domains can vary, for example: https://{0}.mydomain.com https://snapshop-a.mydomain.com or https://www.snapshop-b.com
All of the above belong to the same SaaS application system. We need to dynamically generate the corresponding domain URLs. Could you please show us how to achieve this?
We are currently using PAYUNi as our payment provider (https://www.payuni.com.tw/). Will using different payment providers have any impact?
In this case, you would typically need to capture the user's domain dynamically at runtime and set the RootUrl accordingly. Depending on how your application is structured, you might consider using the Request object to determine the domain of the current request and configure the RootUrl based on that.
For example:
.Configure<PaymentWebOptions>(options =>
{
var currentDomain = HttpContext.Request.Host.Value; // Get the current domain dynamically
options.RootUrl = $"https://{currentDomain}";
options.CallbackUrl = $"https://{currentDomain}/Payment/Success";
options.GatewaySelectionCheckoutButtonStyle = configuration["Payment:GatewaySelectionCheckoutButtonStyle"];
});
This approach grabs the domain from the current HTTP request, allowing each user to have their own dynamically configured RootUrl.
Okay, thank you for your help.
In my scenario, two-factor authentication (2FA) is turned off in the MVC host application, but the settings menu continues to show up in the Angular frontend.
Even though I've disabled 2FA at the host/tenant level, the option still shows up in the menu.
Related docs: ABP - Two-Factor Authentication (User Side) https://abp.io/docs/latest/modules/identity/two-factor-authentication#user-side