don't include empty social media link in email

This commit is contained in:
Nathan Coad
2019-09-03 08:24:06 +10:00
parent 5276e4bca1
commit 22bad5d8ef

View File

@@ -290,44 +290,39 @@ max-width: 100% !important; } }
</div>
<!--[if mso]></td></tr></table><![endif]-->
<div align="center" style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px;">
<div style="line-height:10px;font-size:1px">&#160;</div>
<div style="display: table; max-width:171px;">
<!--[if (mso)|(IE)]>
<table width="151" cellpadding="0" cellspacing="0" border="0"><tr><td style="border-collapse:collapse; padding-right: 10px; padding-left: 10px; padding-bottom: 10px;" align="center">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:151px;">
<tr>
<![endif]-->
<?php foreach ($social_links as $linkitem) : ?>
<?php if (isset($linkitem['text'])) : ?>
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;Margin-right: 15px">
<tbody><tr style="vertical-align: top"><td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="<?php print $linkitem['linkurl'] ?>" title="<?php print $linkitem['text'] ?>" target="_blank">
<img src="<?php print $linkitem['imageurl'] ?>" alt="<?php print $linkitem['text'] ?>" title="<?php print $linkitem['text'] ?>" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
<div style="line-height:5px;font-size:1px">&#160;</div>
</td></tr>
</tbody></table>
<!--[if (mso)|(IE)]></td><![endif]-->
<?php endif; ?>
<?php endforeach; ?>
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
<div style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">
<!--[if (mso)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px;padding-left: 10px; padding-top: 10px; padding-bottom: 10px;"><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
<div align="center"><div style="border-top: 1px solid #BBBBBB; width:100%; line-height:1px; height:1px; font-size:1px;">&#160;</div></div>
<!--[if (mso)]></td></tr></table></td></tr></table><![endif]-->
</div>
<!-- Social Media section -->
<div align="center" style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px;">
<div style="line-height:10px;font-size:1px">&#160;</div>
<div style="display: table; max-width:171px;">
<!--[if (mso)|(IE)]>
<table width="151" cellpadding="0" cellspacing="0" border="0"><tr><td style="border-collapse:collapse; padding-right: 10px; padding-left: 10px; padding-bottom: 10px;" align="center">
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; mso-table-lspace: 0pt;mso-table-rspace: 0pt; width:151px;">
<tr>
<![endif]-->
<?php foreach ($social_links as $linkitem) : ?>
<?php if (isset($linkitem['text']) && (! empty($linkitem['text']))) : ?>
<!--[if (mso)|(IE)]><td width="32" style="width:32px; padding-right: 15px;" valign="top"><![endif]-->
<table align="left" border="0" cellspacing="0" cellpadding="0" width="32" height="32" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;Margin-right: 15px">
<tbody><tr style="vertical-align: top"><td align="left" valign="middle" style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<a href="<?php print $linkitem['linkurl'] ?>" title="<?php print $linkitem['text'] ?>" target="_blank">
<img src="<?php print $linkitem['imageurl'] ?>" alt="<?php print $linkitem['text'] ?>" title="<?php print $linkitem['text'] ?>" width="32" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: block !important;border: none;height: auto;float: none;max-width: 32px !important">
</a>
<div style="line-height:5px;font-size:1px">&#160;</div>
</td></tr>
</tbody></table>
<!--[if (mso)|(IE)]></td><![endif]-->
<?php endif; ?>
<?php endforeach; ?>
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
<div style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">
<!--[if (mso)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px;padding-left: 10px; padding-top: 10px; padding-bottom: 10px;"><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
<div align="center">
<div style="border-top: 1px solid #BBBBBB; width:100%; line-height:1px; height:1px; font-size:1px;">&#160;</div>
</div>
<!--[if (mso)]></td></tr></table></td></tr></table><![endif]-->
</div>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
@@ -337,6 +332,4 @@ max-width: 100% !important; } }
</div> <!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</div>
<!--[if (mso)|(IE)]></div><![endif]-->
</body></html>