Skip to content

Commit

Permalink
mailgun: better handle different api url formats
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfee committed Dec 30, 2021
1 parent 07de4e5 commit d19f7d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions email.go
Expand Up @@ -191,6 +191,8 @@ func (emailer *Emailer) NewMailgun(url, key string) {
// Mailgun client takes the base url, so we need to trim off the end (e.g 'v3/messages')
if strings.Contains(url, "messages") {
url = url[0:strings.LastIndex(url, "/")]
}
if strings.Contains(url, "v3") {
url = url[0:strings.LastIndex(url, "/")]
}
sender.client.SetAPIBase(url)
Expand Down

0 comments on commit d19f7d6

Please sign in to comment.