mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-12 05:22:35 +09:00
Remove trailing whitespace
This commit is contained in:
parent
3b0030e82b
commit
a9f72a5cd2
81 changed files with 2455 additions and 2455 deletions
|
|
@ -11,54 +11,54 @@ class SparkPost extends Base implements \Rhymix\Framework\Drivers\MailInterface
|
|||
* The API URL.
|
||||
*/
|
||||
protected static $_url = 'https://api.sparkpost.com/api/v1/transmissions';
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of configuration fields required by this mail driver.
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getRequiredConfig()
|
||||
{
|
||||
return array('api_token');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the SPF hint.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getSPFHint()
|
||||
{
|
||||
return 'include:sparkpostmail.com';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the DKIM hint.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getDKIMHint()
|
||||
{
|
||||
return '********._domainkey';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the current mail driver is supported on this server.
|
||||
*
|
||||
*
|
||||
* This method returns true on success and false on failure.
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isSupported()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send a message.
|
||||
*
|
||||
*
|
||||
* This method returns true on success and false on failure.
|
||||
*
|
||||
*
|
||||
* @param object $message
|
||||
* @return bool
|
||||
*/
|
||||
|
|
@ -87,7 +87,7 @@ class SparkPost extends Base implements \Rhymix\Framework\Drivers\MailInterface
|
|||
$recipients[] = array('address' => array('name' => $name, 'email' => $address));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Prepare data and options for Requests.
|
||||
$headers = array(
|
||||
'Authorization' => $this->_config['api_token'],
|
||||
|
|
@ -106,11 +106,11 @@ class SparkPost extends Base implements \Rhymix\Framework\Drivers\MailInterface
|
|||
'timeout' => 5,
|
||||
'useragent' => 'PHP',
|
||||
);
|
||||
|
||||
|
||||
// Send the API request.
|
||||
$request = \Requests::post(self::$_url, $headers, $data, $options);
|
||||
$result = @json_decode($request->body);
|
||||
|
||||
|
||||
// Parse the result.
|
||||
if (!$result)
|
||||
{
|
||||
|
|
@ -124,7 +124,7 @@ class SparkPost extends Base implements \Rhymix\Framework\Drivers\MailInterface
|
|||
$message->errors[] = 'SparkPost: ' . $error->message . ': ' . $error->description . ' (code ' . $error->code . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($result->results)
|
||||
{
|
||||
return $result->results->total_accepted_recipients > 0 ? true : false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue