feat: consume transactional email notifications
Add contract validation, SMTP delivery results, terminal failure context, neutral development seeding, and local Docker setup. Ref: IT-1033
This commit is contained in:
@@ -18,11 +18,15 @@ internal sealed class EmailTemplateService : IEmailTemplateService
|
||||
string? languageCode,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var lang = string.IsNullOrWhiteSpace(languageCode) ? "en" : languageCode;
|
||||
var template = await _templateRepository.GetAsync(serviceName, templateKey, lang, cancellationToken);
|
||||
if (string.IsNullOrWhiteSpace(languageCode))
|
||||
throw new InvalidDataException("LanguageCode is required.");
|
||||
|
||||
if (template is null && lang != "en")
|
||||
template = await _templateRepository.GetAsync(serviceName, templateKey, "en", cancellationToken);
|
||||
string lang = languageCode.Trim().ToLowerInvariant();
|
||||
EmailTemplate? template = await _templateRepository.GetAsync(
|
||||
serviceName,
|
||||
templateKey,
|
||||
lang,
|
||||
cancellationToken);
|
||||
|
||||
return template
|
||||
?? throw new InvalidOperationException(
|
||||
|
||||
Reference in New Issue
Block a user