mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-23 01:20:11 +00:00
mailgun: better handle different api url formats
This commit is contained in:
parent
07de4e5015
commit
d19f7d6b53
2
email.go
2
email.go
@ -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')
|
// Mailgun client takes the base url, so we need to trim off the end (e.g 'v3/messages')
|
||||||
if strings.Contains(url, "messages") {
|
if strings.Contains(url, "messages") {
|
||||||
url = url[0:strings.LastIndex(url, "/")]
|
url = url[0:strings.LastIndex(url, "/")]
|
||||||
|
}
|
||||||
|
if strings.Contains(url, "v3") {
|
||||||
url = url[0:strings.LastIndex(url, "/")]
|
url = url[0:strings.LastIndex(url, "/")]
|
||||||
}
|
}
|
||||||
sender.client.SetAPIBase(url)
|
sender.client.SetAPIBase(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user