chore: moving towards agentic development
Some checks failed
Backend CI/CD / build_and_deploy (push) Has been cancelled
Frontend CI/CD / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-04-24 21:12:26 -04:00
parent df3e602015
commit b6eb692c27
179 changed files with 2880 additions and 866 deletions

View File

@@ -0,0 +1,37 @@
using Socialize.Infrastructure.Emailer.Configuration;
using Socialize.Infrastructure.Emailer.Contracts;
using Microsoft.Extensions.Options;
using PostmarkDotNet;
namespace Socialize.Infrastructure.Emailer.Services;
public class PostmarkEmailSender : IEmailSender
{
private readonly PostmarkClient _client;
private readonly EmailerOptions _options;
public PostmarkEmailSender(IOptions<EmailerOptions> options)
{
_options = options.Value;
_client = new PostmarkClient(_options.ApiKey);
}
public async Task SendEmailAsync(string email, string subject, string message)
{
PostmarkResponse? sendResult = await _client.SendMessageAsync(new PostmarkMessage
{
From = _options.FromEmail,
To = email,
Subject = subject,
HtmlBody = message,
TrackOpens = true,
MessageStream = "outbound" // Optional: use "broadcast" for bulk
});
if (sendResult.Status != PostmarkStatus.Success)
{
throw new InvalidOperationException(
$"Postmark failed to send email: {sendResult.Message}");
}
}
}