Skip to content

Commit 90adf01

Browse files
scaleway-botyfodil
andauthored
feat(tem): add field to accept new headers in create email endpoint (#3583)
Co-authored-by: Yacine FODIL <[email protected]>
1 parent 801049b commit 90adf01

File tree

5 files changed

+38
-20
lines changed

5 files changed

+38
-20
lines changed

cmd/scw/testdata/test-all-usage-tem-email-create-usage.golden

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,25 @@ USAGE:
66
scw tem email create [arg=value ...]
77

88
ARGS:
9-
[from.email] Email address
10-
[from.name] (Optional) Name displayed
11-
[to.{index}.email] Email address
12-
[to.{index}.name] (Optional) Name displayed
13-
[cc.{index}.email] Email address
14-
[cc.{index}.name] (Optional) Name displayed
15-
[bcc.{index}.email] Email address
16-
[bcc.{index}.name] (Optional) Name displayed
17-
[subject] Subject of the email
18-
[text] Text content
19-
[html] HTML content
20-
[project-id] Project ID to use. If none is passed the default project ID will be used
21-
[attachments.{index}.name] Filename of the attachment
22-
[attachments.{index}.type] MIME type of the attachment
23-
[attachments.{index}.content] Content of the attachment encoded in base64
24-
[send-before] Maximum date to deliver the email
25-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
9+
[from.email] Email address
10+
[from.name] (Optional) Name displayed
11+
[to.{index}.email] Email address
12+
[to.{index}.name] (Optional) Name displayed
13+
[cc.{index}.email] Email address
14+
[cc.{index}.name] (Optional) Name displayed
15+
[bcc.{index}.email] Email address
16+
[bcc.{index}.name] (Optional) Name displayed
17+
[subject] Subject of the email
18+
[text] Text content
19+
[html] HTML content
20+
[project-id] Project ID to use. If none is passed the default project ID will be used
21+
[attachments.{index}.name] Filename of the attachment
22+
[attachments.{index}.type] MIME type of the attachment
23+
[attachments.{index}.content] Content of the attachment encoded in base64
24+
[send-before] Maximum date to deliver the email
25+
[additional-headers.{index}.key] Email header key
26+
[additional-headers.{index}.value] Email header value
27+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
2628

2729
FLAGS:
2830
-h, --help help for create

docs/commands/tem.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ scw tem email create [arg=value ...]
203203
| attachments.{index}.type | | MIME type of the attachment |
204204
| attachments.{index}.content | | Content of the attachment encoded in base64 |
205205
| send-before | | Maximum date to deliver the email |
206+
| additional-headers.{index}.key | | Email header key |
207+
| additional-headers.{index}.value | | Email header value |
206208
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
207209

208210

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240103152155-b6170c7b5894
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240104151524-ab214475a5a5
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.8.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
386386
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
387387
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
388388
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
389-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240103152155-b6170c7b5894 h1:k0sP67Yer2X9O+F1tK2THU4PVPNsbU3SHzhR80eaJvU=
390-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240103152155-b6170c7b5894/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
389+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240104151524-ab214475a5a5 h1:qoQSzki+34iQa2YStpWCI7qHRRRCxkR7OxaysQCchcI=
390+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240104151524-ab214475a5a5/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
391391
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
392392
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
393393
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/tem/v1alpha1/tem_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,20 @@ func temEmailCreate() *core.Command {
177177
Deprecated: false,
178178
Positional: false,
179179
},
180+
{
181+
Name: "additional-headers.{index}.key",
182+
Short: `Email header key`,
183+
Required: false,
184+
Deprecated: false,
185+
Positional: false,
186+
},
187+
{
188+
Name: "additional-headers.{index}.value",
189+
Short: `Email header value`,
190+
Required: false,
191+
Deprecated: false,
192+
Positional: false,
193+
},
180194
core.RegionArgSpec(scw.RegionFrPar),
181195
},
182196
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)