Handle OtP mail issue. Earlier template was fetched from database now its from file

This commit is contained in:
Vikas Nale 2025-12-15 11:27:50 +05:30
parent 80141c8ffa
commit 1e5c69e6ad
2 changed files with 11 additions and 6 deletions

View File

@ -57,7 +57,10 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="EmailTemplates\NewFolder\" /> <Compile Remove="EmailTemplates\NewFolder\**" />
<Content Remove="EmailTemplates\NewFolder\**" />
<EmbeddedResource Remove="EmailTemplates\NewFolder\**" />
<None Remove="EmailTemplates\NewFolder\**" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -179,13 +179,15 @@ namespace MarcoBMS.Services.Service
{ "OTP_CODE", otp } { "OTP_CODE", otp }
}; };
foreach (var item in replacements) emailBody = await GetEmailTemplate("send-otp", replacements);
{
emailBody = emailBody.Replace($"{{{{{item.Key}}}}}", item.Value); //foreach (var item in replacements)
} //{
// emailBody = emailBody.Replace($"{{{{{item.Key}}}}}", item.Value);
//}
subject = CheckSubject(subject); subject = CheckSubject(subject);
await SendEmailAsync(toEmails, subject, emailBody); await SendEmailAsync(toEmails, "One-Time Password (OTP) for Verification", emailBody);
} }
public async Task SendEmailAsync(List<string> toEmails, string subject, string body) public async Task SendEmailAsync(List<string> toEmails, string subject, string body)
{ {