Created
July 6, 2019 10:12
-
-
Save FredSRocha/be06adc79e35452bcf50e1a783c0bfee to your computer and use it in GitHub Desktop.
SendEmail Template.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Variables | |
$email = "***@gmail.com"; | |
$subject = "Subject Email"; | |
$message = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam velit enim, consequat ut est nec, rutrum blandit enim. Cras ultricies felis ac mattis elementum. Cras justo erat, efficitur et nulla sed, tempus tristique arcu. Donec diam nisl, vehicula vel sollicitudin vitae, facilisis a risus. Nunc fermentum, nibh non lacinia rhoncus, diam lacus fermentum lectus, et tempor dolor risus non est. Donec varius ligula a dignissim rutrum. In non vulputate purus, sit amet sollicitudin lorem. Etiam varius facilisis massa, non bibendum eros congue non. Nulla vel nulla vel lacus pretium sollicitudin quis non mi. Phasellus gravida purus ac eleifend laoreet."; | |
# General | |
define("EMAIL_PARTNER_NAME" , "copy"); | |
define("EMAIL_PARTNER_WEBSITE" , "http://www.example.com"); | |
define("EMAIL_PARTNER_EMAIL" , "contato@site.com"); | |
define("EMAIL_PARTNER_PHONE" , "31999999999"); | |
define("EMAIL_PARTNER_SEND_TO", "Este e-mail foi endereçado para"); | |
define("EMAIL_PARTNER_BTN_ACTION_TITLE", "Entre em contato agora mesmo"); | |
define("EMAIL_PARTNER_BTN_EMAIL_TITLE", "RESPONDER EMAIL"); | |
define("EMAIL_PARTNER_BTN_PHONE_TITLE", "LIGAR"); | |
# Optional | |
define("EMAIL_PARTNER_SLOGAN" , ""); | |
define("EMAIL_PARTNER_INFO_TITLE", ""); | |
define("EMAIL_PARTNER_INFO_MESSAGE", ""); | |
/* | |
<div style="color:#aaa;font-family:Arial;font-size:12px;line-height:16px;text-align:left;padding-bottom:5px"> | |
<strong>' . EMAIL_PARTNER_INFO_TITLE . '</strong> | |
</div> | |
<div style="color:#aaa;font-family:Arial;font-size:12px;line-height:16px;text-align:left;border-bottom:1px solid #e8e8e8;padding-bottom:10px;margin-bottom:10px"> | |
' . EMAIL_PARTNER_INFO_MESSAGE . ' | |
</div> | |
*/ | |
#Attachments | |
define("EMAIL_PARTNER_ATTACHMENT_TITLE", "ANEXOS (Optional)"); | |
define("EMAIL_PARTNER_ATTACHMENT_CLICK_IN_LINK", "*Clique nos links para fazer download dos arquivos. (Optional)"); | |
define("EMAIL_PARTNER_ATTACHMENT_NAME_A" , "Conheça nosso calendário de atividades (Optional)"); | |
define("EMAIL_PARTNER_ATTACHMENT_HREF_NAME_A" , "https://www.example.com/files/calendar/calendar-2017.pdf"); | |
define("EMAIL_PARTNER_ATTACHMENT_DOWNLOAD_NAME_A" , "calendar-2017.pdf"); | |
define("EMAIL_PARTNER_ATTACHMENT_NAME_B" , "Saiba mais sobre nós (Optional)"); | |
define("EMAIL_PARTNER_ATTACHMENT_HREF_NAME_B" , "https://www.example.com/files/blog/posts/splash-page.pdf"); | |
define("EMAIL_PARTNER_ATTACHMENT_DOWNLOAD_NAME_B" , "splash-page.pdf"); | |
/* | |
<div style="color:#aaa;font-family:Arial;font-size:12px;line-height:16px;text-align:left;padding:5px 0"> | |
<strong>' . EMAIL_PARTNER_ATTACHMENT_TITLE . '</strong> | |
</div> | |
<div style="color:#aaa;font-family:Arial;font-size:12px;line-height:16px;text-align:left"> | |
<div style="padding: 10px 0"><a href="' . EMAIL_PARTNER_ATTACHMENT_HREF_NAME_A . '" download="' . EMAIL_PARTNER_ATTACHMENT_DOWNLOAD_NAME_A . '"><strong>' . EMAIL_PARTNER_ATTACHMENT_NAME_A . '</strong></a></div> | |
<div style="padding: 10px 0"><a href="' . EMAIL_PARTNER_ATTACHMENT_HREF_NAME_B . '" download="' . EMAIL_PARTNER_ATTACHMENT_DOWNLOAD_NAME_B . '"><strong>' . EMAIL_PARTNER_ATTACHMENT_NAME_B . '</strong></a></div> | |
<div style="color:#f44336;font-family:Arial;font-size:12px;line-height:16px;text-align:left;padding-top:5px">' . EMAIL_PARTNER_ATTACHMENT_CLICK_IN_LINK . '</div> | |
</div> | |
*/ | |
$body = | |
'<div itemscope itemprop="organization" itemtype="http://schema.org/Organization" style="margin:0 auto;max-width:600px;background:#f1f1f1"> | |
<table> | |
<tbody> | |
<tr> | |
<td style="text-align:center;vertical-align:top;direction:ltr;font-size:0px;padding:0 0 20px 0px"> | |
<img width="100%" height="auto" itemprop="image" src="https://pbs.twimg.com/media/D75tqtVW4AYhIFm.jpg" alt="Alt IMG"/> | |
</td> | |
</tr> | |
<tr> | |
<td style="word-break:break-word;font-size:0px;padding:8px 16px" align="left"> | |
<div style="color:#000000;font-family:Arial;font-size:16px;line-height:22px;text-align:left" itemprop="description"> | |
' . $message . ' | |
</div> | |
</td> | |
</tr> | |
<tr> | |
<td style="word-break:break-word;font-size:0px;padding:20px 25px 0px" align="center"> | |
<div style="padding: 0 0 10px 0"> | |
<img width="100%" height="auto" itemprop="logo" src="https://country1025.com/wp-content/uploads/sites/19/2019/05/uber-2.jpg?width=600&maxheight=314&anchor=middlecenter&mode=crop" alt="' . EMAIL_PARTNER_NAME . '" style="border-radius:15px;"/> | |
<span itemprop="name" style="display:none"><a itemprop="url" href="' . EMAIL_PARTNER_WEBSITE . '">' . EMAIL_PARTNER_NAME . '</a></span> | |
</div> | |
<div style="color:#444;font-family:Arial;font-size:16px;line-height:22px;text-align:center"> | |
' . EMAIL_PARTNER_SLOGAN . ' | |
</div> | |
</td> | |
</tr> | |
<tr> | |
<td style="text-align:left;vertical-align:top;direction:ltr;font-size:0px"> | |
<div style="color:#999;font-family:Arial;font-size:14px;font-weight:bold;line-height:30px;text-align:center;padding:0 25px"> | |
' . EMAIL_PARTNER_BTN_ACTION_TITLE . ' | |
</div> | |
</td> | |
</tr> | |
<tr> | |
<td style="word-break:break-word;font-size:0px;padding:8px 16px;padding-bottom:0px;text-align:center" align="left"> | |
<a href="mailto:' . EMAIL_PARTNER_EMAIL . '" target="_blank" style="color:#fff;text-decoration:none"> | |
<div style="margin:0 15px 15px;padding:15px;background: #FFC107;background: -webkit-linear-gradient(to left, #FFC107, #FFEB3B);background: linear-gradient(to left, #FFC107, #FFEB3B);border-radius:4px;color:#333;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:700;line-height:20px;text-align:center;text-decoration:none;min-width:200px;-webkit-box-shadow:0 1px 4px 0 rgba(0,0,0,.14);box-shadow:0 1px 4px 0 rgba(0,0,0,.14)"> | |
<div style="font-weight:300;color:#a17a02">' . EMAIL_PARTNER_EMAIL . '</div> | |
<strong>' . EMAIL_PARTNER_BTN_EMAIL_TITLE . '</strong> | |
</div> | |
</a> | |
<a href="tel:0' . EMAIL_PARTNER_PHONE . '" target="_blank" style="color:#fff;text-decoration:none"> | |
<div style="margin:0 15px 15px;padding:15px;background: #FFC107;background: -webkit-linear-gradient(to left, #FFC107, #FFEB3B);background: linear-gradient(to left, #FFC107, #FFEB3B);border-radius:4px;color:#333;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:700;line-height:20px;text-align:center;text-decoration:none;min-width:200px;-webkit-box-shadow:0 1px 4px 0 rgba(0,0,0,.14);box-shadow:0 1px 4px 0 rgba(0,0,0,.14)"> | |
<div style="font-weight:300;color:#a17a02">' . EMAIL_PARTNER_PHONE . '</div> | |
<strong>' . EMAIL_PARTNER_BTN_PHONE_TITLE . '</strong> | |
</div> | |
</a> | |
</td> | |
</tr> | |
<tr> | |
<td style="word-break:break-word;font-size:0px;padding:10px 0 10px 0" align="center"> | |
<div style="color:#aaa;font-family:Arial;font-size:12px;line-height:16px;text-align:center;font-weight:700;"> | |
© 2019 ' . EMAIL_PARTNER_NAME . ' | |
</div> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
</div>'; | |
/* | |
<tr> | |
<td style="word-break:break-word;font-size:0px;padding:15px 20px 10px 20px;border-top:1px solid #e8e8e8" align="center"> | |
<div style="color:#aaa;font-family:Arial;font-size:12px;line-height:16px;text-align:left"> | |
' . EMAIL_PARTNER_SEND_TO . ' (<span style="text-decoration:underline;color:#177000"><a href="mailto:' . $email . '" target="_target">' . $email . '</a></span>) | |
</div> | |
</td> | |
</tr> | |
*/ | |
$Email = new SendGridEmail(); | |
$Email::sendGrid($email, $subject, $body, $message); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment