mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix(email): validate settings before sending; use hmac for tokens
This commit is contained in:
@@ -16,6 +16,11 @@ namespace SharpbinV3.Server.Services
|
||||
|
||||
public async Task SendAsync(string to, string subject, string body)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(settings.Host) || string.IsNullOrWhiteSpace(settings.User) || string.IsNullOrWhiteSpace(settings.Password))
|
||||
{
|
||||
logger.LogWarning($"Email settings are not fully configured. Skipping sending email to {to}");
|
||||
return;
|
||||
}
|
||||
var email = new QueuedEmail(to, subject, body);
|
||||
|
||||
if (queue.Writer.TryWrite(email))
|
||||
|
||||
Reference in New Issue
Block a user