用于 Mailgun API 的 Go 库。
Go library for interacting with the Mailgun API.
If you are using Go Modules make sure you
include the /v5 at the end of your import paths
go get github.com/mailgun/mailgun-go/v5
…
…
The mailgun library has built-in support for polling the events api
…
…
…
…
Templates enable you to create message templates on your Mailgun account and then populate the data variables at send-time. This allows you to have your layout and design managed on the server and handle the data on the client. The template variables are added as a JSON stringified X-Mailgun-Variables header. For example, if you have a template to send a password reset link, you could do the following:
…
The official mailgun documentation includes examples using this library. Go here.
European customers will need to change the default API Base to access your domains
mg := mailgun.NewMailgun("MAILGUN_API_KEY")
mg.SetAPIBase(mailgun.APIBaseEU)
We are trying to keep breaking changes to a minimum, but sometimes they are necessary.
We are guaranteeing that there will be no breaking changes within a major version.
List of changes are in Release v5.0.0.
// Deprecated: comments in the code) and follow the recommendations there.
This should make the major version bump go more smoothly./v5 at the end, e.g.import "github.com/mailgun/mailgun-go/v5"
WARNING - running the tests will cost you money!
To run the tests various environment variables must be set. These are:
MG_DOMAIN is the domain name - this is a value registered in the Mailgun admin interface.MG_API_KEY is the Private API key - you can get this value from the Mailgun security pageMG_EMAIL_TO is the email address used in various sending tests.and finally
MG_SPEND_MONEY if this value is set the part of the test that use the API to actually send email will be run - be aware this will count on your quota and this will cost you money.The code is released under a 3-clause BSD license. See the LICENSE file for more information.
暂无开放 Issues,或尚未同步最近议题。