Why getting hyphen in gmail subject? - ruby-on-rails

I am using Devise gem and when I send my web application, every time, I got extra hyphen (-) in gmail subject like below:
I wonder that I am getting this hyphen in gmail but I am not getting this issue in other client like Outlook or Yandex or Thunderbird mail client.
My ruby code for this subject:
def confirmation_instructions(record, token, opts={})
mail = super
if record.german?
mail.subject = 'Herzlich Willkommen bei WebMail'.strip
else
mail.subject = 'Welcome to WebMail'.strip
end
mail
end
mailer_view(confirmation_instructions.html.erb):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" style="font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta name="x-apple-disable-message-reformatting">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="telephone=no" name="format-detection">
<title></title>
</head>
<body style="width:100%;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;padding:0;Margin:0">
<span style="display:none !important;font-size:0px;line-height:0;color:#ffffff;visibility:hidden;opacity:0;height:0;width:0;mso-hide:all"></span>
<div class="es-wrapper-color" style="background-color:#F6F6F6">
<!--[if gte mso 9]>
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
<v:fill type="tile" color="#f6f6f6"></v:fill>
</v:background>
<![endif]-->
<table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;padding:0;Margin:0;width:100%;height:100%;background-repeat:repeat;background-position:center top">
<tr>
<td valign="top" style="padding:0;Margin:0">
<table class="es-header" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top">
<tr>
<td align="center" style="padding:0;Margin:0">
<table class="es-header-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:650px">
<tr>
<td class="esdev-adapt-off" style="padding:0;Margin:0;padding-left:20px;padding-right:20px;background-color:#ffffff" bgcolor="#ffffff" align="left">
<table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td class="es-m-p0r" align="center" style="padding:0;Margin:0;width:610px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td class="es-m-p40r es-m-p40l" style="padding:30px;Margin:0;font-size:0px" align="center"><img class="adapt-img" src="https://lvddhx.stripocdn.email/content/guids/CABINET_8087737a290d7f16a2c9e3ecdca34c00/images/14811631711643580.png" alt style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" width="180"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table class="es-content" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%">
<tr>
<td align="center" style="padding:0;Margin:0">
<table class="es-content-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:650px">
<tr>
<td align="left" style="padding:0;Margin:0">
<table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td valign="top" align="center" style="padding:0;Margin:0;width:650px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr class="es-mobile-hidden">
<td style="padding:0;Margin:0"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;line-height:24px;color:#333333;font-size:16px;width:0;height:0;border-top:0px solid transparent;border-left:600px solid transparent;border-bottom:20px solid transparent"></p></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table class="es-content" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%">
<tr>
<td align="center" style="padding:0;Margin:0">
<table class="es-content-body" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#ffffff;width:650px" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center">
<tr>
<td class="es-m-p20r es-m-p20l" align="left" style="Margin:0;padding-bottom:20px;padding-top:40px;padding-left:40px;padding-right:40px">
<table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td valign="top" align="center" style="padding:0;Margin:0;width:570px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<% salutation = if #resource.role == 'employee'
if #resource.userable.male?
#resource.german? ? "Lieber Herr" : "Dear Mr"
elsif #resource.userable.female?
#resource.german? ? "Liebe Frau" : "Dear Ms"
else
#resource.german? ? "Guten Tag" : "Dear "
end
else
#resource.german? ? "Guten Tag" : "Dear "
end
%>
<% email_name = if #resource.role == 'employee'
if #resource.userable.male?
#resource.userable.last_name
elsif #resource.userable.female?
#resource.userable.last_name
else
#resource.userable.full_name
end
else
Organization.find(#resource.userable.id).user.full_name
end
%>
<% creator_name = if #resource.role == 'employer'
Organization.find(#resource.userable.id).user.full_name
elsif #resource.role == 'sub_end_client'
Organization.find(Organization.find(#resource.userable.id).parent_id).user.full_name
elsif #resource.role == 'sub_employer'
Organization.find(Organization.find(#resource.userable.id).parent_id).user.full_name
elsif #resource.role == 'employee'
Employee.find(#resource.userable.id).organization.user.full_name
else
if Organization.find(#resource.userable.id).added_by.nil?
Organization.find(#resource.userable.id).user.full_name
else
Organization.find(#resource.userable.id).added_by.full_name
end
end
%>
<% creator_company = if #resource.role == 'employer'
Organization.find(#resource.userable.id).name
elsif #resource.role == 'sub_end_client'
Organization.find(Organization.find(#resource.userable.id).parent_id).name
elsif #resource.role == 'end_client'
if Organization.find(#resource.userable.id).added_by.nil?
Organization.find(#resource.userable.id).name
else
Organization.find(User.find(Organization.find(#resource.userable.id).added_by.id).userable_id).name
end
#Organization.find(User.find(Organization.find(#resource.id).added_by.id).userable_id).name
elsif #resource.role == 'sub_employer'
Organization.find(Organization.find(#resource.userable.id).parent_id).name
elsif #resource.role == 'employee'
Employee.find(#resource.userable.id).organization.name
else
if Organization.find(#resource.userable.id).added_by.nil?
Organization.find(#resource.userable.id).name
else
Organization.find(User.find(Organization.find(#resource.userable.id).added_by.id).userable_id).name
#Organization.find(#resource.userable.id).added_by.name
end
end
%>
<% role = if #resource.role=='employee'
if #resource.english?
"Employee"
else
"Arbeitnehmer"
end
elsif #resource.role=='employer'
if #resource.english?
"Employer"
else
"Arbeitgeber"
end
elsif #resource.role=='end_client'
if #resource.english?
"End Client"
else
"Endkunden"
end
elsif #resource.role=='sub_end_client'
if #resource.english?
"Sub End Client"
else
"Endkunden Sub-Benutzer"
end
elsif #resource.role=='sub_employer'
if #resource.english?
"Sub Employer"
else
"Arbeitgeber Sub-Benutzer"
end
else
if #resource.english?
"Admin"
else
"Arbeitgeber"
end
end
%>
<% if #resource.english? %>
<% if #resource.role == 'employer' %>
<tr><td>
<p><%= salutation %> <%= email_name %>,</p>
</td></tr>
<tr><td>
<p>We are very pleased to welcome you as our new webmail customer.</p>
<p>Your employer profile has already been successfully created.</p>
<p>To access webmail, please confirm your account using the button below and then set your personal password to activate the account.</p>
</td></tr>
<tr>
<td align="left" style="padding:0;Margin:0"> <%= link_to("Confirm account", confirmation_url(#resource, confirmation_token: #token), class: "es-button es-button-1", style: "mso-style-priority:100 !important;text-decoration:none;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;color:#FFFFFF;font-size:16px;border-style:solid;border-color:#0e8799;border-width:10px 25px;display:inline-block;background:#0e8799;border-radius:8px;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;font-weight:normal;font-style:normal;line-height:19px;width:auto;text-align:center") %> </td>
</tr>
<tr><td>
<p>Once you have successfully activated your account, you can log in to webmail with your email address and password and get started right away with the first steps such as creating employee profiles, sub-users and end clients. They will be notified by email once they have been successfully created. </p>
<p>For your employees, webmail is also available as a mobile app, which can be downloaded according to the mobile device at the links below: </p>
<p>For iOS: https://apps.apple.com/ch/app/webmail/id1557907123</p>
<p>For Android: https://play.google.com/store/apps/details?id=com.webmail.ag</p>
</td></tr>
<tr><td>
<p>If you have any questions, please feel free to contact us by e-mail at: support#webmail.ch or by phone at +41 71 697 00 00.</p>
<p>We are looking forward to a successful and pleasant cooperation!</p>
</td></tr>
<% elsif #resource.role == "end_client" %>
<tr><td><p>Dear <%= salutation %> <%= email_name %>,</p></td></tr>
<p>Sobald Sie Ihr Konto erfolgreich aktiviert haben, können Sie sich mit Ihrer E-Mail Adresse und Ihrem Passwort bei webmail anmelden und direkt mit den ersten Schritten, wie der Erstellung von Arbeitnehmer-Profilen, Sub-Benutzernund Endkunden, loslegen. Diese werden per E-Mail benachrichtigt, sobald Sie erfolgreich erstellt wurden.</p>
<p>Für Ihre Arbeitnehmer ist webmail auch als Mobile App verfügbar, welche dem mobilen Endgerät entsprechend unter den nachfolgenden Links heruntergeladen werden können: </p>
<p>Für iOS: https://apps.apple.com/ch/app/webmail/id1557907123</p>
<p>Für Android: https://play.google.com/store/apps/details?id=com.webmail.ag</p>
</td></tr>
<tr><td>
<p>Bei Fragen können Sie uns gerne per E-Mail unter: support#webmail.ch oder per Telefon unter +41 71 697 00 00 erreichen.</p>
<p>Wir freuen uns auf eine erfolgreiche und angenehme Zusammenarbeit!</p>
</td></tr>
<% elsif #resource.role == "end_client" %>
<tr><td><p><%= salutation %> <%= email_name %>,</p></td></tr>
<tr><td>
<p>Es freut uns Ihnen mitzuteilen, dass Ihr webmail <%= role %> -Konto erfolgreich von <%= creator_name %> der Firma <%= creator_company %> erstellt wurde. </p>
<p>Um auf webmail zugreifen zu können, bestätigen Sie bitte Ihr Konto mittels untenstehendem Button und legen anschliessend Ihr persönliches Passwort fest, um das Konto zu aktivieren.</p>
</td></tr>
<tr>
<td align="left" style="padding:0;Margin:0"> <%= link_to("Konto bestätigen", confirmation_url(#resource, confirmation_token: #token), class: "es-button es-button-1", style: "mso-style-priority:100 !important;text-decoration:none;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;color:#FFFFFF;font-size:16px;border-style:solid;border-color:#0e8799;border-width:10px 25px;display:inline-block;background:#0e8799;border-radius:8px;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;font-weight:normal;font-style:normal;line-height:19px;width:auto;text-align:center") %> </td>
</tr>
<tr><td>
<p>Sobald Sie Ihr Konto erfolgreich aktiviert haben, können Sie sich mit Ihrer E-Mail Adresse und Ihrem Passwort bei webmail anmelden und direkt loslegen.</p>
</td></tr>
<% elsif #resource.role == "sub_employer" %>
<tr><td><p><%= salutation %> <%= email_name %>,</p></td></tr>
<tr><td>
<p>Es freut uns Ihnen mitzuteilen, dass Ihr webmail <%= role %> -Konto erfolgreich von <%= creator_name %> der Firma <%= creator_company %> erstellt wurde. </p>
<p>Um auf webmail zugreifen zu können, bestätigen Sie bitte Ihr Konto mittels untenstehendem Button und legen anschliessend Ihr persönliches Passwort fest, um das Konto zu aktivieren.</p>
</td></tr>
<tr>
<td align="left" style="padding:0;Margin:0"> <%= link_to("Konto bestätigen", confirmation_url(#resource, confirmation_token: #token), class: "es-button es-button-1", style: "mso-style-priority:100 !important;text-decoration:none;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;color:#FFFFFF;font-size:16px;border-style:solid;border-color:#0e8799;border-width:10px 25px;display:inline-block;background:#0e8799;border-radius:8px;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;font-weight:normal;font-style:normal;line-height:19px;width:auto;text-align:center") %> </td>
</tr>
<tr><td>
<p>Sobald Sie Ihr Konto erfolgreich aktiviert haben, können Sie sich mit Ihrer E-Mail Adresse und Ihrem Passwort bei webmail anmelden und direkt loslegen.</p>
</td></tr>
<% elsif #resource.role == "sub_end_client" %>
<tr><td><p><%= salutation %> <%= email_name %>,</p></td></tr>
<tr><td>
<p>Es freut uns Ihnen mitzuteilen, dass Ihr webmail <%= role %> -Konto erfolgreich von <%= creator_name %> der Firma <%= creator_company %> erstellt wurde. </p>
<p>Um auf webmail zugreifen zu können, bestätigen Sie bitte Ihr Konto mittels untenstehendem Button und legen anschliessend Ihr persönliches Passwort fest, um das Konto zu aktivieren.</p>
</td></tr>
<tr>
<td align="left" style="padding:0;Margin:0"> <%= link_to("Konto bestätigen", confirmation_url(#resource, confirmation_token: #token), class: "es-button es-button-1", style: "mso-style-priority:100 !important;text-decoration:none;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;color:#FFFFFF;font-size:16px;border-style:solid;border-color:#0e8799;border-width:10px 25px;display:inline-block;background:#0e8799;border-radius:8px;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;font-weight:normal;font-style:normal;line-height:19px;width:auto;text-align:center") %> </td>
</tr>
<tr><td>
<p>Sobald Sie Ihr Konto erfolgreich aktiviert haben, können Sie sich mit Ihrer E-Mail Adresse und Ihrem Passwort bei webmail anmelden und direkt loslegen.</p>
</td></tr>
<% else %>
<tr><td><p><%= salutation %> <%= email_name %>,</p></td></tr>
<tr><td>
<p>Es freut uns Ihnen mitzuteilen, dass Ihr webmail <%= role %> -Konto erfolgreich von <%= creator_name %> der Firma <%= creator_company %> erstellt wurde. </p>
<p>Um auf webmail zugreifen zu können, bestätigen Sie bitte Ihr Konto mittels untenstehendem Button und legen anschliessend Ihr persönliches Passwort fest, um das Konto zu aktivieren.</p>
</td></tr>
<tr>
<td align="left" style="padding:0;Margin:0"> <%= link_to("Konto bestätigen", confirmation_url(#resource, confirmation_token: #token), class: "es-button es-button-1", style: "mso-style-priority:100 !important;text-decoration:none;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;color:#FFFFFF;font-size:16px;border-style:solid;border-color:#0e8799;border-width:10px 25px;display:inline-block;background:#0e8799;border-radius:8px;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;font-weight:normal;font-style:normal;line-height:19px;width:auto;text-align:center") %> </td>
</tr>
<tr><td>
<p>Sobald Sie Ihr Konto erfolgreich aktiviert haben, können Sie sich mit Ihrer E-Mail Adresse und Ihrem Passwort im Web wie auch in der Mobile App anmelden und direkt loslegen.</p>
<p>Die Mobile App können Sie einfach und bequem Ihrem mobilen Endgerät entsprechend
unter den nachfolgenden Links herunterladen:</p>
<p>Für iOS: https://apps.apple.com/ch/app/webmail/id1557907123</p>
<p>Für Android: https://play.google.com/store/apps/details?id=com.webmail.ag</p>
</td></tr>
<% end %>
<% end %>
</table>
<table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;margin-top:25px">
<tr>
<td valign="top" align="center" style="padding:0;Margin:0;width:570px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<% if #resource.english? %>
<td align="left" style="padding:0;Margin:0"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;line-height:24px;color:#333333;font-size:16px">Kindest regards,</p><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;line-height:24px;color:#333333;font-size:16px">Your webmail Team</p></td>
<% else %>
<td align="left" style="padding:0;Margin:0"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;line-height:24px;color:#333333;font-size:16px">Freundliche Grüsse</p><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;line-height:24px;color:#333333;font-size:16px">Ihr webmail Team</p></td>
<% end %>
</tr>
</table></td>
</tr>
</table>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table class="es-footer" cellspacing="0" cellpadding="0" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top">
<tr>
<td align="center" style="padding:0;Margin:0">
<table class="es-footer-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:650px">
<tr>
<td class="es-m-p20r es-m-p20l" align="left" style="Margin:0;padding-top:30px;padding-bottom:40px;padding-left:40px;padding-right:40px">
</td>
</tr>
<tr>
<td style="Margin:0;padding-left:20px;padding-right:20px;padding-bottom:25px;padding-top:30px;background-color:#20202a" bgcolor="#20202A" align="left">
<table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td valign="top" align="center" style="padding:0;Margin:0;width:610px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td style="padding:0;Margin:0;padding-top:20px;padding-bottom:30px;font-size:0" align="center">
<table class="es-table-not-adapt es-social" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td valign="top" align="center" style="padding:0;Margin:0;padding-right:20px"><img title="Facebook" src="https://lvddhx.stripocdn.email/content/assets/img/social-icons/logo-gray/facebook-logo-gray.png" alt="Fb" width="32" height="32" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic"></td>
<td valign="top" align="center" style="padding:0;Margin:0;padding-right:20px"><img title="Twitter" src="https://lvddhx.stripocdn.email/content/assets/img/social-icons/logo-gray/twitter-logo-gray.png" alt="Tw" width="32" height="32" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic"></td>
<td valign="top" align="center" style="padding:0;Margin:0;padding-right:20px"><img title="Instagram" src="https://lvddhx.stripocdn.email/content/assets/img/social-icons/logo-gray/instagram-logo-gray.png" alt="Inst" width="32" height="32" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic"></td>
<td valign="top" align="center" style="padding:0;Margin:0"><img title="Youtube" src="https://lvddhx.stripocdn.email/content/assets/img/social-icons/logo-gray/youtube-logo-gray.png" alt="Yt" width="32" height="32" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="es-m-p10r es-m-p10l" align="center" style="padding:0;Margin:0;padding-top:20px;padding-left:40px;padding-right:40px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:roboto, 'helvetica neue', helvetica, arial, sans-serif;line-height:18px;color:#ffffff;font-size:12px"><%= t('mail.footer.help') %><br></p></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>
My question is why I am getting this hyphen (-) in gmail subject in?
How to fix this issue?

That hyphen is simply part of Gmail’s user interface. It’s there to separate the subject line and what is usually refered to as the preheader. The preheader is automatically detected by Gmail based on the first HTML text content it can grab inside your email. My guess is that something here is wrong with the way you send your HTML email.

Related

the divider line way too long on outlook

I have coded an email template and it works great overall but I have an issue with the length of the divider line:
The divider is way too long when I send a test mail to my outlook mail but have the right length on all other mail clients.
<table border="0" agrepeatingblock="active" role="presentation" cellpadding="0" width="100%" cellspacing="0" style="width: 100%;" agid="greenline-development_group_2_block_11">
<tr>
<td align="center" style="vertical-align:top;padding:Block::Margin_top|INTEGER|0px 0 Block::Margin_bottom|INTEGER|0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="width:100%;background-color:Block::Block_container|COLOR|transparent;">
<tr>
<td align="center" style="vertical-align: top;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="width:100%;" role="presentation">
<tr>
<td align="center" valign="top" width="100%" style="width:100%; max-width:706px">
<![endif]-->
<table border="0" cellpadding="0" width="100%" cellspacing="0" style="width:100%;max-width:706px;Margin:0 auto;background-color:Block::Content_container|COLOR|transparent;" role="presentation">
<tr>
<td align="center" style="vertical-align:top;padding:${blockparam:Block::Padding_top|INTEGER|10}px 12px 0;" class="pt-10">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%;">
<tr>
<td align="center" style="vertical-align: top; padding: 10px 12px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%;">
<tr>
<td
height="${blockparam:Block::Padding_bottom|INTEGER|10}"
style="border-top:${blockparam:Horizontal_rule::Size|INTEGER|1}px solid ${blockparam:Horizontal_rule::Color|COLOR|#47c16c};height:${ref:Block::Padding_bottom}px;font-size:${ref:Block::Padding_bottom}px;line-height:${ref:Block::Padding_bottom}px;"
class="h-sm-10"
></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>

How to set website logo image on signup mail in rails?

I am using rails 5 when user is registered in my website i am sending an email for him for account approval.I want to set website logo with email.
How we implement this in rails mailer view file
Html for mail template
<!DOCTYPE HTML>
<html>
<title>nytApp Email</title>
<head>
</head>
<body style="font-family: 'arial', sans-serif !important; font-size: 14px; line-height: 20px; color:#3e3e3e; background-color: #f5f5f5; font-weight: 300;">
<!-- Container Table -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="640" style="margin:0 auto; background:#fff;">
<tr>
<td style="border: 1px solid #f5cd8f;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="padding: 25px 15px 20px; border-bottom: 1px solid #f5cd8f;">
<table align="center" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td><%= image_path('logo.png')%></td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-weight: bold; font-size: 16px;">
<tr>
<td style="color: #ff5e00; font-weight: 300; font-size: 20px;">Welcome to Nytapp</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding: 0 15px 20px;">
<table align="center" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td height="10"></td></tr>
<tr>
<td>Thank you for signing up as Events Promoter!</td>
</tr>
<tr><td height="25"></td></tr>
<tr>
<td>You are ready to start posting your parties for free. Login to the portal by clicking on the link below:</td>
</tr>
<tr><td height="10"></td></tr>
<tr>
<td>https://nytapp.com</td>
</tr>
<tr><td height="10"></td></tr>
<tr>
<td>If the above URL does not work try copying and pasting it into your browser.</td>
</tr>
<tr><td height="8"></td></tr>
<tr>
<td>If you encounter any problem, please contact us at admin#nytapp.com</td>
</tr>
<tr><td height="25"></td></tr>
<tr>
<td>Thank you,</td>
</tr>
<tr>
<td>The Nytapp team</td>
</tr>
<tr><td height="30"></td></tr>
</table>
</td>
</tr>
<tr>
<td style="border-top: 1px solid #f5cd8f; vertical-align: middle; padding: 10px 15px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<%= image_path('logo.png') %>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
In mailer you can't give relative path. So try upload your logo somewhere in cloud like s3 and give complete logo url in image tag source.
You can also use asset_url it compute complete url.
<%= image_tag asset_url('logo.png') %>
In your html.erb file which is suppose to be send as mail
you need to wrtte something like this.....
<img src=" <%= Rails.application.secrets.host + "" + asset_path("sd_logo.png") %>"

Campaign Monitor importing template: unsubscript tag not found

I try to import an email-template in campaign monitor, but it shows always the same problem:
No unsubscribe link We require a single-click unsubscribe link in every campaign you send. Please add the tags and around the words you want to become an unsubscribe link.
What I do not understand is, that I have the tag in my template:
<layout label="POST-FOOTER25">
<table width="100%" bgcolor="#fff" cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
<tbody>
<tr>
<td width="100%">
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center" class="devicewidthinner">
<tbody>
<!-- Top Spacing -->
<tr>
<td width="100%" height="10" style="font-size: 0;line-height: 0;border-collapse: collapse;"> </td>
</tr>
<!-- Top Spacing -->
<tr>
<td width="100%">
<table width="560" cellpadding="0" cellspacing="0" border="0" align="center" class="devicewidthinner">
<tbody class="">
<tr class="">
<td width="100%" align="right" valign="middle" style="font-family: 'Open Sans', Arial, sans-serif; font-size: 12px; line-height: 16px; color: rgb(62, 69, 76); text-align: center; font-weight: 400;" mgedit="text" class="aligncenter">
<multiline label="text617_86">
<!--[if !mso]><!-->
<span style="font-family: 'Open Sans', Arial, sans-serif;">
<!--<![endif]-->
You are receiving this email because you subscribed for updates on our website. <unsubscribe>Click here to Unsubscribe</unsubscribe><br /><br />
<preferences>Manage your subscription</preferences>
<!--[if !mso]><!-->
</span>
<!--<![endif]-->
</multiline>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Bottom Spacing -->
<tr>
<td width="100%" height="10" style="font-size: 0;line-height: 0;border-collapse: collapse;"> </td>
</tr>
<!-- Bottom Spacing -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</layout>
There is no comment or if-case around the unsubscribe-tag. Any other idea?
Greets, yab86
I'd recommend moving the unsubscribe and preferences markup out of the multiline markup area. It's likely their system doesn't recognize it because it's put into the editable multiline WYSIWYG Editor

Rails4 template error in mailer in production

On in my production env. I keep getting this error:
ActionView::Template::Error: undefined method `protocol' for nil:NilClass
I can't figure out where this error are in my template, can anybody help me figure this out?
CODE UPDATE
Complete code: Pastebin
I cut out, the area I think might cause problem:
<tr>
<td class="eHeader" style="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="">
<tr>
<td class="eHeader" style="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="">
<tr>
<td class="eHeaderLogo" style="">
<a href="#" style="">
<img class="imageFix" src="<%= image_url('crewnetlogo-white.png') %>" width="200" height="48" alt="Crewnet" style="">
</a>
</td>
<!-- end .eHeaderLogo-->
<td class="eHeaderOptions" style="">
</td>
<!-- end .eHeaderOptions-->
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<h1>
<span>
Du er blevet tildelt <%= #workplace.name %>
</span>
</h1>
<div class="bannerLink">
<a href="#" style="">
<img src="<%= image_url "app.png" %>" alt="Crewnet" width="512" height="194" style="">
</a>
</div>
</td>
<!-- end .highlight-->
</tr>
<tr>
<td class="eBody bottomLine" style="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="entryBox" style="">
<tr>
<td class="width132 pdBt16" style="">
<a href="#" style="">
<img src="<%= image_url "file_icon.gif" %>" width="116" height="116" alt="File" style="">
</a>
</td>
<td class="alignLeft" style="">
<p style="">
Hej <%= #user.name %>!<br>
Du har fået tildelt <%= #workplace.name %> som ansvarsområde. <br>
For mere info log på CrewNet | <%= #workplace.name %>.
</p>
<p style="">
Skulle du have nogle spørgsmål, kan du kontakte supporten på support#crewnet.dk.
<br>
<br>
Teamet bag CrewNet.dk
</p>
</td>
</tr>
</table>
</td>
<!-- end .eBody-->
</tr>
Mailer
class SupervisorMailer < ActionMailer::Base
default from: "support#crewnet.dk"
def assigned(user, workplace)
#user = User.find(user)
#workplace = Workplace.find(workplace)
mail to: #user.email, subject: "Du er ansvarlig for #{#workplace.name}."
end
end
production.rb
config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name, :protocol => "http" }
config.action_mailer.asset_host = Rails.application.secrets.domain_name
env
secrets.domain_name = crewnet.dk
Probably it's realted to url building. Do you have asset_host setting in your production.rb? Maybe you have to add protocol to asset_host?
Rails.application.configure do
...
config.action_mailer.asset_host = 'http://example.com'
...
end

how to replace coding in gsp?

how to replace the coding in the finePrint?
that large textArea i call "finePrint"...
this is my problem...i am confusing..
when i filled with HMTL's coding..with ${name} on gsp..
like this..
look the arrow...thats have a button submit at below finePrint..when i click that...
the g:textField of "Your Name" thats i fill with "Bobby"..it will be replace in the finePrint with ${name}..
this ini my gsp coding where i fill it to finePrint..
<table align="center" >
<tbody>
<tr style="border-spacing:0!important;border-collapse:collapse!important;color:#666666;background-color:#F8F8F8" align="center">
<td style="padding:35px 75px 60px 75px;background-color:#fafafa;">
<table style="border-spacing:0!important;border-collapse:collapse!important;color:#666666;" width="80%">
<tbody>
<tr>
<td>
<p align="center"><img alt="Tempo AI" border="0"/></p>
<h1 style="font-family:Arial,Helvetica,sans-serif;color:#ee710b;font-size:30px;font-weight:normal;width:450px">${name}, you requested to reset your Password</h1>
<p style="padding:0;margin:0 0 15px 0;">To reset your password, just click the link below.</p>
<p style="padding:0;margin:0 0 15px 0;">Reset Password</p>
<p style="padding:0;margin:0;">Best,</p>
<p style="padding:0;margin:0;color:#bcbcbc;font-size:20px;">Tempo Team</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="font-family:Arial, Helvetica, sans-serif;padding-top:15px;" align="center" >
<td style="font-family:Arial, Helvetica, sans-serif;padding-top:15px;" align="center">
<p style="margin-top:0;margin-bottom:10px;">
<a href="http://www.facebook.com" style="text-decoration:none;">
<img alt="Facebook" border="0"/>
</a>
<a href="http://www.twitter.com" style="text-decoration:none;">
<img alt="Twitter" border="0"/>
</a>
<a href="http://www.plus.google.com" style="text-decoration:none;">
<img alt="Google+" border="0"/>
</a>
<a href="http://www.mail.yahoo.com" style="text-decoration:none;">
<img alt="Email" border="0"/>
</a>
</p>
<p style="margin-top:0;margin-bottom:8px;font-size:12px;font-weight:bold;">
<a style="color:#666666;text-decoration:none;">
ABOUT
</a>
<a style="color:#666666;text-decoration:none;">
PRIVACY
</a>
<a style="color:#666666;text-decoration:none;">
TERM OF USE
</a>
</p>
<p style="padding:0;margin:0;font-size:10px;color:#999999;font-weight:bold;">
If you would like to change your email notification settings
<a style="color:#44b1d9;" href="www.w3school.com">click here</a>
</p>
<p style="padding:0;margin:0;font-size:10px;color:#999999;font-weight:bold;">
© 2012 Tempo
</p>
</td>
</tr>
</tbody>
</table>
and this is my SMTP coding when i click submit..it will send email to abc#yahoo.com
def send = {
sendMail {
multipart true
to params.email
from "s_yoshitsune#yahoo.com"
subject "Test Reset Password"
html params.finePrint
}
render params.finePrint
}
and the result when i received email..
i want the ${name} replaced by my name(Bobby) where i fill before
this is coding for submit email address..
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main"/>
<g:javascript src='jquery-1.6.2.min.js'/>
<g:javascript src='jquery.cleditor.min.js'/>
<g:javascript src='test.js'/> <%-- cara import file JavaScript/ JS --%>
<link rel="stylesheet" href="${resource(dir: 'css', file: 'cleditor/jquery.cleditor.css')}" type="text/css"> <%-- cara import file CSS --%>
<title>Reset Password</title>
</head>
<body>
<g:form action="send">
<table style="width:500px">
<tbody>
<tr>
<td>Your Email Address </td>
<%-- <td><input style="width:250px" name="email" /></td>--%>
<td><g:textField style="width:250px" name = "email"/></td>
</tr>
<tr>
<td>Your Name</td>
<td><g:textField style="width:250px" name = "user"/></td>
</tr>
<tr>
<td colspan="4">
<g:textArea name="finePrint"/>
</td>
</tr>
<tr>
<td><input type="submit"/></td>
</tr>
</tbody>
</table>
</g:form>
<div id="finePrintBlank" style="display:none;" title="${message(code: 'campaign.finePrint.label')}">
<p>${message(code: 'default.blank.message', args: [message(code: 'campaign.finePrint.label')])}</p>
</div>
</body>
</html>
In the gsp page, you can prepopulate finePrint with your html code like this,
<g:textArea name="finePrint">
<table align="center" >
<tbody>
...etc...
${name}, you requested to reset your password.
...rest of the data...
</tbody>
</table>
<g:textArea>
That will be processed on the server side and you should have your the name resolved before it reached the client.
...etc...
${domainInstance.name}, you requested to reset your password.
...rest of the data...

Resources