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

How to escape '<' in email subject? #785

Closed
rohanrajpal opened this issue Apr 24, 2022 · 7 comments
Closed

How to escape '<' in email subject? #785

rohanrajpal opened this issue Apr 24, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@rohanrajpal
Copy link

rohanrajpal commented Apr 24, 2022

If I add < in email subject

image

it appears as
image

How do I escape it?

@rohanrajpal rohanrajpal changed the title How to escape '< How to escape '<' in email subject? Apr 24, 2022
@rohanrajpal
Copy link
Author

potentially related issue
https://stackoverflow.com/a/48527166

@knadh knadh added the bug Something isn't working label Apr 25, 2022
@knadh
Copy link
Owner

knadh commented Apr 25, 2022

Whoops, this is a bug. Subject line templating should indeed use template/text. For now, you can use the Safe escape function.

{{ .Subscriber.Name }} {{ Safe "<>" }} Hello

@rohanrajpal
Copy link
Author

{{ Safe "<>" }}

This works! Thanks, was the above stack overflow link useful or the issue is different?

@knadh
Copy link
Owner

knadh commented Apr 25, 2022

Same issue. Subject line should use plain text template processing instead of HTML.

@wweverma1
Copy link

@knadh Can I take up this issue?

@knadh
Copy link
Owner

knadh commented May 2, 2022

Yes, sure. Just have to change this to template/text here:

subjTpl, err := template.New(ContentTpl).Funcs(f).Parse(subj)

@wweverma1
Copy link

@knadh Hi, I've raised a PR against this.
#799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants