MCPcopy Create free account
hub / github.com/aptabase/aptabase / Render

Method Render

src/Features/Notification/TemplateEngine.cs:12–24  ·  view source on GitHub ↗
(string name, string subject, Dictionary<string, string>? properties)

Source from the content-addressed store, hash-verified

10 private readonly Dictionary<string, string> _templates = new();
11
12 public async Task<string> Render(string name, string subject, Dictionary<string, string>? properties)
13 {
14 var baseTemplate = await GetTemplate("Base");
15 var emailTemplate = await GetTemplate(name);
16
17 if (properties is not null)
18 {
19 foreach (var (key, value) in properties)
20 emailTemplate = emailTemplate.Replace($"##{key.ToUpper()}##", HttpUtility.HtmlEncode(value));
21 }
22
23 return baseTemplate.Replace("##SUBJECT##", subject).Replace("##BODY##", emailTemplate);
24 }
25
26 public async Task<string> GetTemplate(string name)
27 {

Callers 3

SendEmailAsyncMethod · 0.80
SendEmailAsyncMethod · 0.80
SendEmailAsyncMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected