bcomeau / parse-server-mailgun-adapter-template

Used to send Parse Server password reset and email verification emails though Mailgun
Other
11 stars 12 forks source link

%link% variable is rendered once only. #8

Closed ashecret closed 8 years ago

ashecret commented 8 years ago

If %link% variable is used in more than one places, let's say one in a link button and one as plain text in a paragraph, it's rendered in the first place only. I have tried switching places and using other html attributes.

alsoft-alex commented 8 years ago

My problem, too. It is because the replace function replaces only the first occurrence of a string.

The issue could easily be solved like this:

function fillVariables(text, options) { text = text.split("%username%").join(options.user.get("username")); text = text.split("%email%").join(options.user.get("email")); text = text.split("%appname%").join(options.appName); text = text.split("% link%").join(options.link); return text; }

bcomeau commented 8 years ago

Fixed in PR #9

alsoft-alex commented 8 years ago

Merci, c'était rapide :-)