Closed chhatch closed 4 years ago
I'm not sure what your issue is - your expected and actual output seems to be the same?
My bad, the subject appears as Check this out: Foo & Bar
What does your subject.pug
look like?
It seems to me that since you're using !=
it should work fine. Is there some sort of encoding going on? Try this to see output debug information in console when you try again:
- console.log('the subject mySubject was', mySubject)
!= `Check this out: ${mySubject}`
Updated example*
Here's what we got:
the subject mySubject was AHA CPR & AED & First Aid
What's odd is that span !{mysubject}
gives the expected output in html.pug
I don't have time presently but ping me back in 24-48 hours if you still can't figure it out.
You can also run with DEBUG=*
flag, or specifically DEBUG=email-templates
or DEBUG=preview-email
.
Will do. You've been very helpful so far.
I solved the issue by grabbing a value on the front end with el.innerText
instead of el.innerHTML
, which I should have been doing anyway. This was user error.
I really appreciate you helping me track down the issue so quickly.
Great!
Obligatory sponsor link https://github.com/sponsors/niftylettuce
I trying to use a subject like 'Check this out: Foo & Bar' for a subject line in an email. Part of the subject comes from a variable, mySubject, with the value 'Foo & Bar'. My subject.pug looks like this:
!= `Check this out: ${mySubject}`
But appears asCheck this out: Foo & Bar
in my test emails.I'm not sure what else to try. Any idea? Thanks!