From ad31df874affdbfa9b862a002fb2fdd21cdde178 Mon Sep 17 00:00:00 2001 From: Loic Mahieu Date: Thu, 29 Sep 2022 13:55:12 +0200 Subject: [PATCH] CreateDomain: add support of `web_scheme` --- domains.go | 4 ++++ domains_test.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/domains.go b/domains.go index 99c428b0..6642fb50 100644 --- a/domains.go +++ b/domains.go @@ -273,6 +273,7 @@ type CreateDomainOptions struct { ForceDKIMAuthority bool DKIMKeySize int IPS []string + WebScheme string } // CreateDomain instructs Mailgun to create a new domain for your account. @@ -308,6 +309,9 @@ func (mg *MailgunImpl) CreateDomain(ctx context.Context, name string, opts *Crea if len(opts.Password) != 0 { payload.addValue("smtp_password", opts.Password) } + if opts.WebScheme != "" { + payload.addValue("web_scheme", string(opts.WebScheme)) + } } var resp DomainResponse err := postResponseFromJSON(ctx, r, payload, &resp) diff --git a/domains_test.go b/domains_test.go index 38e0a7d7..481e4189 100644 --- a/domains_test.go +++ b/domains_test.go @@ -76,7 +76,7 @@ func TestAddDeleteDomain(t *testing.T) { // First, we need to add the domain. _, err := mg.CreateDomain(ctx, "mx.mailgun.test", - &mailgun.CreateDomainOptions{SpamAction: mailgun.SpamActionTag, Password: "supersecret"}) + &mailgun.CreateDomainOptions{SpamAction: mailgun.SpamActionTag, Password: "supersecret", WebScheme: "https"}) ensure.Nil(t, err) // Next, we delete it.