Releases: mailgun/mailgun-go
Releases · mailgun/mailgun-go
v5.0.0-rc.1
What's Changed
Breaking changes:
Mailgun client is now domain agnostic
- No need to pass the domain into the
func mailgun.NewMailgun
- Many methods now require passing a domain, which indicates which methods are domain-specific and which are global for your account.
- Pay attention to that
func NewMessage(domain, from, subject, text string, to ...string) *PlainMessage
has a variadicto
argument, so there would be no compile error if you miss passingdomain
.
- Pay attention to that
Types and mocks
- API requests, responses, and helper types are moved into
github.com/mailgun/mailgun-go/v5/mtypes
package. Event
interface and parsers moved togithub.com/mailgun/mailgun-go/v5/events
- mocks moved to
github.com/mailgun/mailgun-go/v5/mocks
to address #322 and #332
Validation
ValidateEmail(...)
moved toMailgun
.- The
IsValid
field is removed from the response; useRisk
.
Subaccounts
SubaccountDetails(ctx context.Context, subaccountId string)
renamed toGetSubaccount(ctx context.Context, subaccountID string)
for consistency.
Domains:
- Deprecated
func UpdateDomainTrackingWebPrefix
is removed, usefunc UpdateDomain
. func VerifyAndReturnDomain
is removed, usefunc VerifyDomain
.
Metrics
- The deprecated field
ESPBlockCount
has been removed. UseTemporaryFailedESPBlockCount
.
Other changes
These changes might be breaking in some cases.
-
Send(ctx context.Context, m SendableMessage) (mes string, id string, err error)
now accepts interface. -
SetAPIBase()
now returns an error. -
For the EU: do
mg.SetAPIBase(mailgun.APIBaseEU)
instead ofmg.SetAPIBase("https://api.eu.mailgun.net/v...")
. -
The Webhook Signing Key is optional now and does not relate to the API key. If the Webhook Signing Key is not set(by
SetWebhookSigningKey(webhookSigningKey string)
), don't call theVerifyWebhookSignature()
method, as it will always fail. -
mailgun.MailgunImpl
is renamed tomailgun.Client
for not stuttering.
PRs
- DE-1386 removed deprecated (mg *MailgunImpl) NewMessage method by @vtopc in #365
- DE-1387 Remove func (mg *MailgunImpl) NewMIMEMessage(…) *Message by @vtopc in #366
- DE-1388 (mg *MailgunImpl) Send should accept interface, not struct by @vtopc in #368
- DE-1394 Remove deprecated v3 Validation by @vtopc in #371
- DE-1392 Remove deprecated GetStats by @vtopc in #372
- DE-1410 Remove deprecated GetStoredMessageForURL() and GetStoredMessageRawForURL() methods by @vtopc in #373
- DE-1411 Remove deprecated VerifyWebhookRequest() method by @vtopc in #374
- DE-1390 Remove CaptureCurlOutput by @vtopc in #375
- DE-1384 Domain agnostic API by @vtopc in #376
- DE-1383 Move the API version out of the base URL by @vtopc in #377
- DE-1383 Move the API version out of the base URL 2 by @vtopc in #378
- DE-1394 Removed deprecated v3 validation fields by @vtopc in #379
- DE-1384 Domain agnostic client(fix example) by @vtopc in #380
- DE-1412 Move ValidateEmail() to MailgunImpl by @vtopc in #383
- DE-1416 Switch subaccounts to v5 by @vtopc in #384
- backport #386 by @vtopc in #387
- DE-1417 Switch domains to v4 by @vtopc in #388
- DE-1389 Make Webhook Signing Key optional by @vtopc in #390
- DE-1449 Metrics: Remove Deprecated ESPBlockCount by @vtopc in #392
- DE-1393 Move API Mailgun requests, responses, and helper types into a separate package by @vtopc in #393
- DE-1393 Move public mocks to subfolder by @vtopc in #394
- DE-1391 Enable more linters by @vtopc in #395
- DE-1146 github.com/mailgun/mailgun-go/v5 by @vtopc in #396
Full Changelog: v4.22.2...v5.0.0-rc.1
v4.22.2
v4.22.1
v4.22.0
What's Changed
- check all PRs by @vtopc in #364
- Bump github.com/go-chi/chi/v5 from 5.1.0 to 5.2.0 by @dependabot in #369
- DE-1138 Generate models by @vtopc in #370
- EASY-522: Deprecate analytics esp_block_count by @forcewhisperer in #382
New Contributors
- @forcewhisperer made their first contribution in #382
Full Changelog: v4.21.0...v4.22.0