Skip to content

Commit

Permalink
Allow user-defined enpoint
Browse files Browse the repository at this point in the history
This allows the user to set an endpoint when using the Sparkpost transport.
  • Loading branch information
36864 committed Apr 17, 2018
1 parent 0f787c7 commit 09aadce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Mail/Transport/SparkPostTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = nul

$message->setBcc([]);

$response = $this->client->post('https://api.sparkpost.com/api/v1/transmissions', [
$endpoint = $this->getOptions()['endpoint'] ?? 'https://api.sparkpost.com/api/v1/transmissions';

$response = $this->client->post($endpoint, [
'headers' => [
'Authorization' => $this->key,
],
Expand Down

1 comment on commit 09aadce

@dmcbrn
Copy link

@dmcbrn dmcbrn commented on 09aadce Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You define the endpoint in config/services.php as:

'sparkpost' => [
    'secret' => env('SPARKPOST_SECRET'),
    'options' => [
        'endpoint' => env('SPARKPOST_ENDPOINT','https://api.eu.sparkpost.com/api/v1')
    ]
],

Please sign in to comment.