feat(backend): Implement email service infrastructure for Day 7
Add complete email service infrastructure with Mock and SMTP implementations. Changes: - Created EmailMessage domain model for email data - Added IEmailService interface for email sending - Implemented MockEmailService for development/testing (logs emails) - Implemented SmtpEmailService for production SMTP sending - Added IEmailTemplateService interface for email templates - Implemented EmailTemplateService with HTML templates for verification, password reset, and invitation emails - Registered email services in DependencyInjection with provider selection - Added email configuration to appsettings.Development.json (Mock provider by default) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,18 @@ public static class DependencyInjection
|
||||
services.AddScoped<IPasswordHasher, PasswordHasher>();
|
||||
services.AddScoped<IRefreshTokenService, RefreshTokenService>();
|
||||
|
||||
// Email Services
|
||||
var emailProvider = configuration["Email:Provider"] ?? "Mock";
|
||||
if (emailProvider.Equals("Mock", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
services.AddSingleton<IEmailService, MockEmailService>();
|
||||
}
|
||||
else
|
||||
{
|
||||
services.AddScoped<IEmailService, SmtpEmailService>();
|
||||
}
|
||||
services.AddScoped<IEmailTemplateService, EmailTemplateService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user