Kitura / Kitura/Swift-SMTP

HTML Body File Template with Variables

Open
#124 5 comments 0 reactions 2 assignees Claimed by @dannys42 View on GitHub
question
Dominant language
Swift
Stars
290
Forks
68
PR merge metrics
No merged PRs in 30d

Description

Other SMTP / email libraries for JS or Python have the ability to "render" an html files and pass through variables.

ie.. pseudo code:

```
var htmlTemplate = fs.readFileSync('./views/email-welcome.html', 'utf-8')

data = {
orgName: organizationName,
orgTitle: orgTitle,
email: email,
}
var emailHTML = ejs.render(htmlTemplate, data);
_sendMailgunEmail(from, email, 'Welcome to my app!', emailHTML);
```

I know I can pass html as a string and use variable that way, but that would make a for a lot in one file. Any other suggestions or could something like this be possible as feature request?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.