Forwarding mail that was made with Jinja Template button is unclickable

22 Views Asked by At

This simple HTML template containing a button with a link that is generated from our backend. By using Jinja we insert this link to the button.

HTML Template

<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<!--[if mso]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch><o:AllowPNG/></o:OfficeDocumentSettings></xml><![endif]-->
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Cabin" rel="stylesheet" type="text/css"/>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css"/>
</head>
<body style="background-color: transparent; margin: 0; padding: 0; -webkit-text-size-adjust: none; text-size-adjust: none;">
<table border="0" cellpadding="10" cellspacing="0" class="button_block" role="presentation" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt;" width="100%">
<tr>
<td>
<div align="center">
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href={{link}} style="height:54px;width:175px;v-text-anchor:middle;" arcsize="0%" strokeweight="0.75pt" strokecolor="#8412c0" fillcolor="#8412c0"><w:anchorlock/><v:textbox inset="0px,0px,0px,0px"><center style="color:#ffffff; font-family:Arial, sans-serif; font-size:16px"><![endif]--><a href={{link}} style="text-decoration:none;display:inline-block;color:#ffffff;background-color:#8412c0;border-radius:0px;width:auto;border-top:1px solid #8412c0;border-right:1px solid #8412c0;border-bottom:1px solid #8412c0;border-left:1px solid #8412c0;padding-top:10px;padding-bottom:10px;font-family:'Cabin', Arial, 'Helvetica Neue', Helvetica, sans-serif;text-align:center;mso-border-alt:none;word-break:keep-all;" target="_blank"><span style="padding-left:40px;padding-right:40px;font-size:16px;display:inline-block;letter-spacing:normal;"><span style="font-size: 16px; line-height: 2; word-break: break-word; mso-line-height-alt: 32px;"><span data-mce-style="font-size: 16px; line-height: 32px;" style="font-size: 16px; line-height: 32px;"><strong><span data-mce-style="line-height: 32px;" style="line-height: 32px;">כניסה לתהליך</span></strong></span></span></span></a>
</div>
</td>
</tr>
</table>
</body>
</html>

Backend Snippet

from jinja2 import Template
                content = Template(open(r"templates/email_templates/app1_files/app1.html",
                                        encoding='utf-8').read())
                rendered = content.render(customer=project.client_name,
                                          service=service_name, id=project_id,
                                          year=project.year, link=extra_link)

We use Outlook the link works. When we forward the mail the button is unclickable, another button that it's link is hard-coded in the HTML Template works.

0

There are 0 best solutions below