I'm sending a transactional HTML email from WordPress when a form is submitted. The email contains information like the person's name, for example, but I also wanted to add a link in the email to a google map.
Link example:
<a>
example:
<a target="_blank" href=" ' . $google_map . ' " style="color:#267ec8; font-size:14px; line-height:22px; font-weight:normal" color="#267ec8"><span style="color:#267ec8; font-size:14px; line-height:22px; font-weight:normal">See map</span></a>
$google_map
is the variable containing the google map URL which is dynamically added by the WP backend. Unfortunately, the link doesn't work when the email is received. Does anyone know how to fix this?
If is possibile you should format the content of the email body adding somethings like this
<?php
$google_map = 'https://www.google.co.uk/maps/place/London/@51.528308,-0.3817765,10z/data=!3m1!4b1!4m2!3m1!1s0x47d8a00baf21de75:0x52963a5addd52a99';
echo '<a target="_blank" href=" ' . $google_map .
' " style="color:#267ec8; font-size:14px; line-height:22px;
font-weight:normal" color="#267ec8">
<span style="color:#267ec8; font-size:14px; line-height:22px;
font-weight:normal">See map</span></a></td>';
?>