Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Add getEndpoint and setEndpoint methods to the MailgunTransport class #29312

Merged
merged 2 commits into from Jul 29, 2019

Conversation

@SerhiiStarovoitov
Copy link
Contributor

commented Jul 28, 2019

If you need to switch (on the fly) your mailgun domain while sending emails you can do it by updating the MailgunTransport "domain" property using the setDomain() method. But if your mailgun domain region is EU, you should also change the endpoint property value from "api.mailgun.net" to "api.eu.mailgun.net".

This PR adds setEndpoint method to MailgunTransport class, so you can do it like this (in your Mailable-class, for example):

$mailTransport = app()->make('mailer')->getSwiftMailer()->getTransport();
$mailTransport->setDomain('yourdomain.com');
$mailTransport->setEndpoint('api.eu.mailgun.net');
* @param string $endpoint
* @return string
*/
public function setEndpoint($endpoint)

This comment has been minimized.

Copy link
@xuanquynh

xuanquynh Jul 28, 2019

Contributor

I think a setter method should return void or $this

This comment has been minimized.

Copy link
@SerhiiStarovoitov

SerhiiStarovoitov Jul 29, 2019

Author Contributor

Yeah, but all the other setter methods (key and domain) return the property value, so I left it the same for the endpoint setter.

@GrahamCampbell GrahamCampbell changed the title Add getEndpoint and setEndpoint methods to the MailgunTransport class [5.8] Add getEndpoint and setEndpoint methods to the MailgunTransport class Jul 28, 2019

@taylorotwell taylorotwell merged commit 0c3d547 into laravel:5.8 Jul 29, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/styleci/pr The analysis has passed
Details
@SerhiiStarovoitov
Copy link
Contributor Author

left a comment

One more typo: #29329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.