You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1001 B
PHTML
44 lines
1001 B
PHTML
|
2 months ago
|
<?php
|
||
|
|
|
||
|
|
namespace App\Services\Mail;
|
||
|
|
|
||
|
|
use App\Services\Config;
|
||
|
|
|
||
|
|
|
||
|
|
class Ses extends Base
|
||
|
|
{
|
||
|
|
protected $client;
|
||
|
|
|
||
|
|
public function __construct()
|
||
|
|
{
|
||
|
|
$this->client = Factory::createSes();
|
||
|
|
}
|
||
|
|
|
||
|
|
public function send($to, $subject, $text, $file)
|
||
|
|
{
|
||
|
|
if (!empty($file)) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
return $this->client->sendEmail([
|
||
|
|
'Destination' => [ // REQUIRED
|
||
|
|
'ToAddresses' => [$to],
|
||
|
|
],
|
||
|
|
'Message' => [ // REQUIRED
|
||
|
|
'Body' => [ // REQUIRED
|
||
|
|
'Html' => [
|
||
|
|
'Data' => $text, // REQUIRED
|
||
|
|
],
|
||
|
|
'Text' => [
|
||
|
|
'Data' => $text, // REQUIRED
|
||
|
|
],
|
||
|
|
],
|
||
|
|
'Subject' => [ // REQUIRED
|
||
|
|
'Data' => $subject, // REQUIRED
|
||
|
|
],
|
||
|
|
],
|
||
|
|
'Source' => $this->getSender(), // REQUIRED
|
||
|
|
]) !== false;
|
||
|
|
}
|
||
|
|
}
|