From d19f7d6b53a145e748405e3ac833e57674251993 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Thu, 30 Dec 2021 02:55:00 +0000 Subject: [PATCH] mailgun: better handle different api url formats --- email.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/email.go b/email.go index dd94029..da5062e 100644 --- a/email.go +++ b/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') 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)