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

DE-1146 Release v5 #367

Merged
merged 37 commits into from
Mar 15, 2025
Merged

DE-1146 Release v5 #367

merged 37 commits into from
Mar 15, 2025

Conversation

vtopc
Copy link
Contributor

@vtopc vtopc commented Dec 15, 2024

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) has a variadic to argument, so there would be no compile error if you miss passing domain.

Types and mocks

Messages

  • Send() and ReSend() methods now returns mtypes.SendMessageResponse.
  • Deprecated NewMessage() and NewMIMEMessage() have been removed, use relative funcs.
  • Deprecated GetStoredMessageForURL method has been removed.
  • Deprecated GetStoredMessageRawForURL method has been removed.

Validation

  • Deprecated NewEmailValidator and NewEmailValidatorFromEnv are removed, use ValidateEmail(...) method of Mailgun.
  • Deprecated IsValid field is removed from the response; use Risk.

Subaccounts

  • Deprecated SubaccountDetails(ctx context.Context, subaccountId string) method is removed, use GetSubaccount(ctx context.Context, subaccountID string).

Domains

  • Deprecated func UpdateDomainTrackingWebPrefix is removed, use func UpdateDomain.
  • Deprecated func VerifyDomain is removed, use func VerifyAndReturnDomain.
  • Deprecated field CreateDomainOptions.IPS is removed, use CreateDomainOptions.IPs.
  • ListEventsWithDomain(opts *ListEventOptions, domain string) -> ListEvents(domain string, opts *ListEventOptions).

Metrics

  • The deprecated field ESPBlockCount has been removed. Use TemporaryFailedESPBlockCount.

IPs

  • Deprecated ListDomainIPS(...) is removed, use ListDomainIPs(...).
  • Deprecated ListIPS(ctx context.Context, dedicated bool) is removed, use ListIPs(ctx context.Context, dedicated, enabled bool) (has new enabled argument).

Webhooks

  • Deprecated VerifyWebhookRequest method has been removed.

Other changes

These changes might be breaking in some cases.

  • Send(ctx context.Context, m Message) method now accepts the Message interface instead of a pointer to struct.

  • SetAPIBase() method now returns an error.

  • For the EU: do mg.SetAPIBase(mailgun.APIBaseEU) instead of mg.SetAPIBase("https://api.eu.mailgun.net/v...").

  • The Webhook Signing Key is now optional and does not relate to the API key. If it is not set(by SetWebhookSigningKey(webhookSigningKey string) method), don't call the VerifyWebhookSignature() method, as it will always fail.

  • mailgun.MailgunImpl is renamed to mailgun.Client for not stuttering.

@vtopc vtopc changed the title DE-1387 Release v5 DE-1146 Release v5 Feb 20, 2025
@vtopc vtopc marked this pull request as ready for review March 1, 2025 14:13
@vtopc vtopc merged commit a9e0a7d into master Mar 15, 2025
2 checks passed
@vtopc vtopc deleted the v5.0.0-RC1 branch March 15, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants