Skip to content

HTML Body File Template with Variables #124

Description

@MattTimmons

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?

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions