The emails that are passed to UserNotifications#notification_email should be being displayed as rtl for rtl users. These are the emails that are sent for things like user_posted, and user_quoted etc. The other notification emails, the ones for things like signup and forgot_password and also the digest, are not being displayed rtl for rtl languages.
The fix for the digest is simple. I can make a pull request for that. The fix for the other emails (signup, forgot_password…) is a little more complicated because they are derived from templates, but the template isn’t wrapped in anything that you can give a direction to.
the emails for rtl will be messed up when there exist English characters.
and the user names can be only English characters.
and the invitation emails start with %{invitee_name}, some part of which is the English user name.
Is there a way to remove the user name in the emails and only contain the full name which can be other characters rather than English?
Sort of. What I am wondering is, what is the proper way to format English words that occur inside of a Persian sentence? Maybe it doesn’t happen very often
It’s possible to add a @dir property to UserNotifications::digest. The @dir property can then be used as a switch for changing all the text-align values in the template. This isn’t very complicated, but it’s slow to test and would have to involve the Discourse team.
Another approach that might be safer would be to include a separate digest_rtl.html.erb view. That way this could be developed without having to alter the current digest.html.erb view.
If that can’t be done, maybe a way could be found to override the digest template with a plugin.
it’d be great if the digest email can be set for both directions, as currently the design of the digest email is very nice, but in the rtl languages it’s damaged especially if there exist an English word in a sentences (which is very probable).
So the problem here is if we create a digest_rtl.html.erb file which is pretty easy and straightforward, How can we make use of it in the core? If someone from the discourse team would help answering this question, we can move forward.
Can the site-font be added to the digest email as well?
p.s.: I’m not sure if fonts are related to the email provider (e.g. yahoo or gmail) or email sender (e.g. the forum). forgive me if the question doesn’t make sense!
if I’m not wrong all the emails, e.g. the invitation email, password changing email, … , are ltr. among them the invitation emails are the most important, especially if one is invited to a topic with an English-Persian title.