Search code examples
htmlcssyahooyahoo-apiyahoo-mail

href in anchor tag is removed by yahoo mail client


below is the email template snippet code that is sent in a mail:

<a href="https:&#x2F;&#x2F;someurl.net&#x2F;reset-password?passwordResetToken&#x3D;Qlc9CFIj8NziJEFuDFXv0uDHZTlzhMbj" style="font-family: 'arial',sans-serif; color: #fff; text-decoration: none; padding: 10px 10px;">TROQUE SUA SENHA</a>

yahoo renders to something like, (missing href)

<a rel="nofollow" style="font-family:'arial', sans-serif;color:#fff;text-decoration:none;padding:10px 10px;">TROQUE SUA SENHA</a>

gmail renders to something like, (which is correct)

<a href="https://someurl.net/reset-password?passwordResetToken=OwNWeKbhoK8TaklFdJRIQWTi7dmCI93A" style="font-family:'arial',sans-serif;color:#fff;text-decoration:none;padding:10px 10px" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://someurl.net/reset-password?passwordResetToken%3DOwNWeKbhoK8TaklFdJRIQWTi7dmCI93A&amp;source=gmail&amp;ust=1588314607785000&amp;usg=AFQjCNEjn0R1PYzmZsDWVFxNzvIhjWG8_A">TROQUE SUA SENHA</a>

Is there any specific anchor tag attribute that should be set to render <a> tag in yahoo client?


Solution

  • Got it resolved, when replaced the html entity hex in href url from &#x2F; to /

    rawTemplate.replace(/&#x2F;/g, '/')
    

    Observed that the gmail mail client handles both html entity hex for slash(&#x2F;) and slash(/), so was able to get the correct anchor link after rendering.

    But the yahoo mail client handles only slash(/) while rendering so had to manually replace