Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Feb 15, 2024
1 parent 0d6ffad commit d0c53a1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions gatherling/email.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

// Use Brevo to send an email from us to a single recipient. Brevo supports multiple recipients, attachments, etc. but we don't need that yet.
function sendEmail($to, $subj, $msg): bool {
function sendEmail($to, $subj, $msg): bool
{
global $CONFIG;

$body = [
'sender' => ['name' => 'Gatherling', 'email' => 'no-reply@gatherling.com'],
'to' => [['name' => $to, 'email' => $to]],
'subject' => $subj,
'htmlContent' => $msg
'sender' => ['name' => 'Gatherling', 'email' => 'no-reply@gatherling.com'],
'to' => [['name' => $to, 'email' => $to]],
'subject' => $subj,
'htmlContent' => $msg,
];

$ch = curl_init();
Expand All @@ -20,7 +21,7 @@ function sendEmail($to, $subj, $msg): bool {

$headers = [];
$headers[] = 'Accept: application/json';
$headers[] = 'Api-Key: ' . $CONFIG['brevo_api_key'];
$headers[] = 'Api-Key: '.$CONFIG['brevo_api_key'];
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

Expand All @@ -32,5 +33,6 @@ function sendEmail($to, $subj, $msg): bool {
if ($response_code >= 300) {
return false;
}

return true;
}

0 comments on commit d0c53a1

Please sign in to comment.