feat: add preprod observability foundation
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using Socialize.Api.Infrastructure.Emailer.Contracts;
|
||||
using Socialize.Api.Infrastructure.Observability;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||
|
||||
internal class LoggerEmailSender(ILogger<IEmailSender> logger)
|
||||
internal class LoggerEmailSender(
|
||||
ILogger<IEmailSender> logger,
|
||||
SocializeMetrics metrics)
|
||||
: IEmailSender
|
||||
{
|
||||
private static readonly Action<ILogger, string, string, string, string, Exception?> LogDevelopmentEmail =
|
||||
@@ -14,6 +17,7 @@ internal class LoggerEmailSender(ILogger<IEmailSender> logger)
|
||||
public Task SendEmailAsync(string email, string subject, string message)
|
||||
{
|
||||
LogDevelopmentEmail(logger, email, subject, Environment.NewLine, message, null);
|
||||
metrics.RecordEmailDelivery("logger", true);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user