Skip to content

Commit

Permalink
Merge pull request #291 from LoicMahieu/feature/domain-web-scheme
Browse files Browse the repository at this point in the history
CreateDomain: add support of `web_scheme`
  • Loading branch information
thrawn01 authored Feb 10, 2023
2 parents 184923c + ad31df8 commit 5bc06f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion domains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5bc06f1

Please sign in to comment.