Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent formatting of {{token}} blocks in draft emails will cause token replacement to fail for HTML #14

Open
benkloester opened this issue Apr 15, 2021 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@benkloester
Copy link

I am not certain I got the root cause of this issue right, but I noticed that the HTML version of the email being sent out inn my test merge had a blank where the name should have been swapped in. Inspecting the html showed that there were tags in the middle of the token - possibly in between some of the parentheses? So naive replacement might have resulted in the replacedment html being interpreted as a malformed tag or something.

Removing formatting from the {{token}} text in my draft fixed it.

It might be worth documenting that this can be an issue.

knmnyn added a commit that referenced this issue Apr 17, 2021
Updates doc to add bug for mentioned issue from @benkloester.

#14
@knmnyn
Copy link
Owner

knmnyn commented Apr 17, 2021

Thanks for the bug report @benkloester . The script uses the global replace on the stringifyied version of the template to do the replacements (Lines 314–316 in the live script; Lines 319–321 in the repo's Code.gs). The replacement ordering is not clearly defined by this method so if your {{token}} replacement requires a certain ordering it may be problematic.

Can you send a screenshot of the issue you face so that I can diagnose it appropriate?

In the meantime, I've updated the README.md to mention the issue.

@knmnyn knmnyn added the documentation Improvements or additions to documentation label Apr 17, 2021
@knmnyn knmnyn self-assigned this Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants