Releases: mailjet/mailjet-apiv3-go
Release v4.0.1
What's Changed
Full Changelog: v4.0.0...v4.0.1
Release v4.0.0
What's Changed
- Remove read_only tag from resource of Listrecipient by @bpatyi in #65
- Add support for
AdvanceErrorHandling
when sending a message by @mariuskiessling in #89 - Fix overriding exclusion state by @tsidei in #91
New Contributors
- @bpatyi made their first contribution in #65
- @mariuskiessling made their first contribution in #89
Full Changelog: v3.2.0...v4.0.0
Release v3.2.0
What's Changed
- Update mailjet_resources.go TemplateID type by @gundersen-fredrik in #48
- Change status of campaigndraft to int by @tuannguyen7 in #63
- Add RequestOptions to SendMail and SendMailV31 by @dselim in #64
- Add request options for the Delete method. by @tsidei in #87
- Add missing
Subject
field to theMessage
struct. by @tsidei in #88
New Contributors
- @gundersen-fredrik made their first contribution in #48
- @tuannguyen7 made their first contribution in #63
- @dselim made their first contribution in #64
Full Changelog: v3.1.1...v3.2.0
Release v3.1.1
#82 use ioutil.ReadAll
instead of io.ReadAll
to better support older Go versions
Release v3.1.0
#80 - return an error that users can do type assertions on
#79 - return an error when calling an unimplemented mock function to avoid getting panics
#78 - fix code examples in README
#77 - fix code snippet in README
#76 - add missing field IsExcludedFromCampaigns
in contact types
#75 - add missing ContactGetcontactslists
type
Fix content-type header value checking
The check of the content type header in http_client.go was a strict equal
Now the check has been made case insensitive and use strings.Contains to check for the content-type format
Sandbox mode patch
The SandBoxMode
field is now located in MessagesV31
struct
If you want to use the sandbox mode to test your emails validity, below is an example
package main
import (
"fmt"
"log"
"os"
mailjet "github.com/mailjet/mailjet-apiv3-go"
)
func main() {
m := mailjet.NewMailjetClient(
os.Getenv("MJ_APIKEY_PUBLIC"),
os.Getenv("MJ_APIKEY_PRIVATE"))
messagesInfo := []mailjet.InfoMessagesV31{
mailjet.InfoMessagesV31{
From: &mailjet.RecipientV31{
Email: "[email protected]",
Name: "Bob Patrick",
},
To: &mailjet.RecipientsV31{
mailjet.RecipientV31{
Email: "[email protected]",
},
},
Subject: "Send API v 3.1 testing",
TextPart: "Hey, that's pretty good!",
},
}
messages := mailjet.MessagesV31{Info: messagesInfo, SandBoxMode: true}
res, err := m.SendMailV31(&messages)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Data: %+v\n", res)
}
Send Api v3.1
In this release we introduced features to use our brand new Send API v3.1
This adds a new function SendMailV31
in the mailjet.Client structure located in mailjet_client.go
Example of implementation can be found in the README
Mocking support
We introduced mocking for the Mailjet driver
This change was aimed at improving the testability of the driver and so it comes with new unit tests based on these mocks
Here is how it works,
The driver is composed of several structs each having their own distinct functional scope
All the driver features are accessible from an instance of mailjet_client
Underneath it there are two major components that fuels these features
If you simply want to keep using the driver, you still can like you used to
However, if you want/need to do unit tests that involves the driver, here is how you can instantiate the driver to inject the HTTP and SMTP clients you need to make that happen
You may inject the HTTP and SMTP mocks available in this repository or you can also use your own as long as they respect the interfaces