Skip to content

Commit a41675d

Browse files
authored
feat(tem): add support for list email per flag (#3292)
1 parent 0dacbb8 commit a41675d

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ARGS:
1717
[subject] (Optional) List emails with this subject
1818
[search] (Optional) List emails by searching to all fields
1919
[order-by] (Optional) List emails corresponding to specific criteria (created_at_desc | created_at_asc | updated_at_desc | updated_at_asc | status_desc | status_asc | mail_from_desc | mail_from_asc | mail_rcpt_desc | mail_rcpt_asc | subject_desc | subject_asc)
20+
[flags.{index}] (Optional) List emails containing only specific flags (unknown_flag | soft_bounce | hard_bounce)
2021
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)
2122

2223
DEPRECATED ARGS:

docs/commands/tem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ scw tem email list [arg=value ...]
278278
| subject | | (Optional) List emails with this subject |
279279
| search | | (Optional) List emails by searching to all fields |
280280
| order-by | One of: `created_at_desc`, `created_at_asc`, `updated_at_desc`, `updated_at_asc`, `status_desc`, `status_asc`, `mail_from_desc`, `mail_from_asc`, `mail_rcpt_desc`, `mail_rcpt_asc`, `subject_desc`, `subject_asc` | (Optional) List emails corresponding to specific criteria |
281+
| flags.{index} | One of: `unknown_flag`, `soft_bounce`, `hard_bounce` | (Optional) List emails containing only specific flags |
281282
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |
282283

283284

internal/namespaces/tem/v1alpha1/tem_cli.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ func temEmailList() *core.Command {
316316
Positional: false,
317317
EnumValues: []string{"created_at_desc", "created_at_asc", "updated_at_desc", "updated_at_asc", "status_desc", "status_asc", "mail_from_desc", "mail_from_asc", "mail_rcpt_desc", "mail_rcpt_asc", "subject_desc", "subject_asc"},
318318
},
319+
{
320+
Name: "flags.{index}",
321+
Short: `(Optional) List emails containing only specific flags`,
322+
Required: false,
323+
Deprecated: false,
324+
Positional: false,
325+
EnumValues: []string{"unknown_flag", "soft_bounce", "hard_bounce"},
326+
},
319327
core.RegionArgSpec(scw.RegionFrPar, scw.Region(core.AllLocalities)),
320328
},
321329
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)