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

@SerhiiStarovoitov SerhiiStarovoitov 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)
Copy link
Contributor

@seriquynh seriquynh Jul 28, 2019

Choose a reason for hiding this comment

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

I think a setter method should return void or $this

Loading

Copy link
Contributor Author

@SerhiiStarovoitov SerhiiStarovoitov Jul 29, 2019

Choose a reason for hiding this comment

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

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

Loading

@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
Loading
Copy link
Contributor Author

@SerhiiStarovoitov SerhiiStarovoitov left a comment

One more typo: #29329

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants