Skip to content

HTML Body File Template with Variables #124

@MattTimmons

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

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions