diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb
index 0a27fddf..62b825ff 100644
--- a/app/views/layouts/mailer.html.erb
+++ b/app/views/layouts/mailer.html.erb
@@ -3,10 +3,9 @@
-
+
-
+
<%= yield %>
<%= render partial: 'shared/mailer_attribution' %>
diff --git a/lib/text_utils.rb b/lib/text_utils.rb
index 3e7668c8..8d33f3ef 100644
--- a/lib/text_utils.rb
+++ b/lib/text_utils.rb
@@ -5,6 +5,14 @@ module TextUtils
module_function
+ def rtl?(text)
+ return false if text.blank?
+
+ text.match?(TextUtils::RTL_REGEXP)
+ rescue Encoding::CompatibilityError
+ false
+ end
+
def maybe_rtl_reverse(text)
if text.match?(RTL_REGEXP)
TwitterCldr::Shared::Bidi