nette / mail

A handy library for creating and sending emails in PHP
https://doc.nette.org/mailing
Other
469 stars 71 forks source link

Message: Subject should never contain   #88

Closed janbarasek closed 2 years ago

janbarasek commented 3 years ago

An email can be created from a template where a fixed space can wander in. This modification removes the fixed spaces from subject.

dg commented 3 years ago

What is the reason for this?

janbarasek commented 3 years ago

In more complex applications where we work with translation, unexpected characters, such as hard spaces, get into the subject. This problem arises when the translator doesn't know whether the text is the subject text or a simple sentence on the web.

Maybe it would be better to use Html::htmlToText() in the setSubject() method.

What do you think?

dg commented 3 years ago

I look in the code and Html::htmlToText is used there. https://github.com/nette/mail/blob/3726ff6bd4bf37c4ab08543080d4a25e535f58df/src/Mail/Message.php#L220

dg commented 3 years ago

@janbarasek I'm missing a reaction :)