You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I'd wanted to thank you for this great lib, I can use to make emails creation a little bit less awful.
IMHO, I wonder why do we have two separate calls at all? In most use cases we do need both html and plaintext variants to compose a message, so it would be great to call render once and get both text and html. If it doesn't make sense for some reason, I'd propose to keep one naming style and rename render to html and generatePlaintext to text. And if you don't worry about the backward compatibility, personally me prefer that kind of interface:
consttemplate=fs.readFileSync(template_name)constmaizzle=newMaizzle(config)const{ html, text }=maizzle.Render(template)
This type of interface is more friendly and support re-use of the initialized Maizzle instance instead of producing a new one each time you call render now.
You can already do render(html, {plaintext: true}), the plaintext method is for cases where you might need to only generate plaintext and not compile any templates.
Please update types.
The text was updated successfully, but these errors were encountered: