Skip to content

Instantly share code, notes, and snippets.

@JesseSumrak
Last active April 7, 2021 15:59
Set Application Mail Configuration
php
<?php
$plainBody = <<<EOF
Hi -first_name- -last_name-,
Thanks for making a purchase with The Little PHP Shop.
We love to do our best to help you learn all about the wonderful world of PHP, from right here in Central Queensland, Australia. We've attached a PDF copy of the invoice for your tax records. If you have any queries or questions, please get in touch with us at billing@thelittlephpshop.com.au.
Looking forward to seeing you again,
The Little PHP Shop Team
EOF;
$htmlBody = <<<EOF
<p>Hi first_name last_name,</p>
<p>Thanks for making a purchase with The Little PHP Shop.</p>
<p>We love to do our best to help you learn all about the wonderful world of PHP, from right here in Central Queensland, Australia. We've attached a PDF copy of the invoice for your tax records. If you have any queries or questions, please get in touch with us at billing@thelittlephpshop.com.au.</p>
<p>Looking forward to seeing you again,</p>
<br>
<p><strong>The Little PHP Shop Team</strong></p>
EOF;
return [
'mail' => [
'from' => [
'address' => $_ENV['SENDGRID_DEFAULT_SENDER_ADDRESS'],
'name' => $_ENV['SENDGRID_DEFAULT_SENDER_NAME'],
],
'replyTo' => [
'address' => $_ENV['SENDGRID_DEFAULT_SENDER_ADDRESS'],
'name' => $_ENV['SENDGRID_DEFAULT_SENDER_NAME'],
],
'templates' => [
'purchase' => [
'plain' => $plainBody,
'html' => $htmlBody,
]
]
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment