Search code examples
ruby-on-railsemailgmailgmail-api

Why getting hyphen in gmail subject?


I am using Devise gem and when I send my web application, every time, I got extra hyphen (-) in gmail subject like below:

enter image description here

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: <a href="https://apps.apple.com/ch/app/webmail/id1557907123">https://apps.apple.com/ch/app/webmail/id1557907123</a></p>
      <p>For Android: <a href="https://play.google.com/store/apps/details?id=com.webmail.ag">https://play.google.com/store/apps/details?id=com.webmail.ag</a></p>
    </td></tr>
  <tr><td>
    <p>If you have any questions, please feel free to contact us by e-mail at: <a href="mailto:[email protected]">[email protected]</a> or by phone at <a href="tel:41716970000">+41 71 697 00 00</a>.</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: <a href="https://apps.apple.com/ch/app/webmail/id1557907123">https://apps.apple.com/ch/app/webmail/id1557907123</a></p>
      <p>Für Android: <a href="https://play.google.com/store/apps/details?id=com.webmail.ag">https://play.google.com/store/apps/details?id=com.webmail.ag</a></p>
    </td></tr>
  <tr><td>
    <p>Bei Fragen können Sie uns gerne per E-Mail unter: <a href="mailto:[email protected]">[email protected]</a> oder per Telefon unter <a href="tel:41716970000">+41 71 697 00 00</a> 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: <a href="https://apps.apple.com/ch/app/webmail/id1557907123">https://apps.apple.com/ch/app/webmail/id1557907123</a></p>
      <p>Für Android: <a href="https://play.google.com/store/apps/details?id=com.webmail.ag">https://play.google.com/store/apps/details?id=com.webmail.ag</a></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"><a href="https://www.facebook.com/webmail-103395514882078/"><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"></a></td>
                          <td valign="top" align="center" style="padding:0;Margin:0;padding-right:20px"><a href="https://twitter.com/webmail"><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"></a></td>
                          <td valign="top" align="center" style="padding:0;Margin:0;padding-right:20px"><a href="https://www.instagram.com/webmail/"><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"></a></td>
                          <td valign="top" align="center" style="padding:0;Margin:0"><a href="https://www.youtube.com"><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"></a></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?


Solution

  • 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.

    A screenshot of Gmail inbox view showing the dash after each subject line.