Skip to content

Instantly share code, notes, and snippets.

@krasenslavov
Last active March 18, 2022 16:16
Show Gist options
  • Save krasenslavov/78f1b5d31c49599e6ff76f6362e23628 to your computer and use it in GitHub Desktop.
Save krasenslavov/78f1b5d31c49599e6ff76f6362e23628 to your computer and use it in GitHub Desktop.
Sending custom emails in WordPress. Visit blog post https://bit.ly/2xlZG9L
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><?php echo $email_custom_data['title'];?> - Company Name</title>
<style>
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url('//fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2') format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
</style>
</head>
<body>
<div width="100%" bgcolor="#fbfbfb" style="background-color:#fbfbfb;font-family:'Roboto',sans-serif;font-size:14px;color:#666666;margin:0">
<div style="max-width:600px;margin:auto">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width:600px">
<tbody>
<!-- Header -->
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<!-- Logo -->
<tr>
<td align="center" style="padding-top:40px;padding-bottom:40px">
<a href="<?php echo esc_url(home_url('/'));?>">
<img src="<?php echo $email_custom_data['logo_url'];?>" alt="" width="75" />
<span style="display:none;">Company Name</span>
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Body -->
<tr>
<td style="padding-bottom:32px">
<table style="border-radius:4px;background:#ffffff;border:solid 1px #ffffff;padding:24px 0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<!-- Featured image -->
<tr>
<td style="padding-bottom:14px">
<div style="width:100%;max-width:100%;text-align:center">
<img src="<?php echo $email_custom_data['featured_image_url'];?>" alt="" width="480" />
</div>
</td>
</tr>
<!-- Title -->
<tr>
<td style="font-weight:600;color:#666666;font-size:24px;text-align:center;letter-spacing:-0.4px;line-height:34px;padding:0 0 16px">
<?php echo $email_custom_data['title'];?>
</td>
</tr>
<!-- Short content summary -->
<tr>
<td style="color:#666666;font-size:16px;line-height:1.8em;text-align:center">
<div style="max-width:408px;width:100%;margin:0 auto">
<?php echo $email_custom_data['content'];?>
</div>
</td>
</tr>
<!-- CTA button -->
<tr>
<td style="text-align:center;padding:24px 0 16px">
<a href="<?php echo $email_custom_data['cta_button_url']; ?>" style="display:inline-block;padding:14px 20px 14px 20px;border-radius:4px;text-align:center;text-decoration:none;color:#ffffff;font-size:16px;background:#0033dd" target="_blank">
<?php echo $email_custom_data['cta_button_text'];?>
</a>
</td>
</tr>
<!-- Aadditional footer content -->
<tr>
<td style="text-align:center;padding-top:20px;padding-bottom:20px;">
<div style="font-weight:600;color:#666666;font-size:24px;text-align:center;letter-spacing:-0.4px;line-height:34px;padding:0 0 16px">
NOT ready to get started?
</div>
<div style="font-size:14px;line-height:1.6;">
Check out our free <a href="<?php echo esc_url(home_url('/tools'));?>" target="_blank" style="color:#0033dd">tools</a>.
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Footer -->
<tr>
<td style="text-align:center;padding:20px 60px">
<div style="font-size:12px;line-height:1.4;color:#cccccc">
Thanks for reading! If you don't want to receive emails from our system you can
<a href="<?php echo esc_url(home_url('/login'));?>" target="_blank" style="color:#0033dd">unsubscribe</a> by updating your settings under the profile page.
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment