mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-26 07:23:06 +01:00
* Onboarding: Invite new users - Separates the user self-registration and invite cases - Adds invitation email for users created by the admin - Adds invitation tokens to verify user was invited - Adds handler action for invite links - Refactors `UserEventHostedService` - Fixes #5726. * Add permissioned form tag helper * Better way of changing a user's role * Test fixes
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using BTCPayServer.Logging;
|
|
|
|
namespace BTCPayServer.Services.Mails
|
|
{
|
|
class ServerEmailSender : EmailSender
|
|
{
|
|
public ServerEmailSender(SettingsRepository settingsRepository,
|
|
IBackgroundJobClient backgroundJobClient,
|
|
Logs logs) : base(backgroundJobClient, logs)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(settingsRepository);
|
|
SettingsRepository = settingsRepository;
|
|
}
|
|
|
|
public SettingsRepository SettingsRepository { get; }
|
|
|
|
public override Task<EmailSettings> GetEmailSettings()
|
|
{
|
|
return SettingsRepository.GetSettingAsync<EmailSettings>();
|
|
}
|
|
|
|
public override async Task<string> GetPrefixedSubject(string subject)
|
|
{
|
|
var settings = await SettingsRepository.GetSettingAsync<ServerSettings>();
|
|
var prefix = string.IsNullOrEmpty(settings?.ServerName) ? "BTCPay Server" : settings.ServerName;
|
|
return $"{prefix}: {subject}";
|
|
}
|
|
}
|
|
}
|