From 8289feb0697e4fead9fd5ad376fe2225eddb2270 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea Date: Fri, 2 Dec 2022 14:06:12 +0100 Subject: [PATCH 1/2] Bring branding emails command under email templates --- internal/cli/branding.go | 4 ++-- internal/cli/email.go | 17 +++++++++++++++++ internal/cli/root.go | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 internal/cli/email.go diff --git a/internal/cli/branding.go b/internal/cli/branding.go index 5c4573fe3..c05da7d3d 100644 --- a/internal/cli/branding.go +++ b/internal/cli/branding.go @@ -84,8 +84,8 @@ func brandingCmd(cli *cli) *cobra.Command { cmd.AddCommand(showBrandingCmd(cli)) cmd.AddCommand(updateBrandingCmd(cli)) cmd.AddCommand(templateCmd(cli)) - cmd.AddCommand(emailTemplateCmd(cli)) cmd.AddCommand(textsCmd(cli)) + return cmd } @@ -119,7 +119,7 @@ Once you close the window, you’ll be asked if you want to save the template. I func emailTemplateCmd(cli *cli) *cobra.Command { cmd := &cobra.Command{ - Use: "emails", + Use: "templates", Short: "Manage custom email templates", Long: "Manage custom email templates. This requires a custom email provider to be configured for the tenant.", } diff --git a/internal/cli/email.go b/internal/cli/email.go new file mode 100644 index 000000000..3206c8da6 --- /dev/null +++ b/internal/cli/email.go @@ -0,0 +1,17 @@ +package cli + +import ( + "github.com/spf13/cobra" +) + +func emailCmd(cli *cli) *cobra.Command { + cmd := &cobra.Command{ + Use: "email", + Short: "Manage email settings", + Long: "Manage email settings.", + } + + cmd.AddCommand(emailTemplateCmd(cli)) + + return cmd +} diff --git a/internal/cli/root.go b/internal/cli/root.go index c6e53a308..6191a0085 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -177,6 +177,7 @@ func addSubcommands(rootCmd *cobra.Command, cli *cli) { rootCmd.AddCommand(rolesCmd(cli)) rootCmd.AddCommand(organizationsCmd(cli)) rootCmd.AddCommand(brandingCmd(cli)) + rootCmd.AddCommand(emailCmd(cli)) rootCmd.AddCommand(customDomainsCmd(cli)) rootCmd.AddCommand(ipsCmd(cli)) rootCmd.AddCommand(quickstartsCmd(cli)) From 2b14fd22bc945e57cad16210f50095ffa3704183 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea Date: Fri, 2 Dec 2022 17:34:05 +0100 Subject: [PATCH 2/2] Update examples for auth0 email templates cmd --- internal/cli/branding.go | 13 ------------- internal/cli/email_templates.go | 21 +++++++++++++++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/cli/branding.go b/internal/cli/branding.go index c05da7d3d..5010123be 100644 --- a/internal/cli/branding.go +++ b/internal/cli/branding.go @@ -117,19 +117,6 @@ Once you close the window, you’ll be asked if you want to save the template. I return cmd } -func emailTemplateCmd(cli *cli) *cobra.Command { - cmd := &cobra.Command{ - Use: "templates", - Short: "Manage custom email templates", - Long: "Manage custom email templates. This requires a custom email provider to be configured for the tenant.", - } - - cmd.SetUsageTemplate(resourceUsageTemplate()) - cmd.AddCommand(showEmailTemplateCmd(cli)) - cmd.AddCommand(updateEmailTemplateCmd(cli)) - return cmd -} - func showBrandingCmd(cli *cli) *cobra.Command { cmd := &cobra.Command{ Use: "show", diff --git a/internal/cli/email_templates.go b/internal/cli/email_templates.go index 951178c0e..ab05228f0 100644 --- a/internal/cli/email_templates.go +++ b/internal/cli/email_templates.go @@ -96,6 +96,19 @@ var ( } ) +func emailTemplateCmd(cli *cli) *cobra.Command { + cmd := &cobra.Command{ + Use: "templates", + Short: "Manage custom email templates", + Long: "Manage custom email templates. This requires a custom email provider to be configured for the tenant.", + } + + cmd.SetUsageTemplate(resourceUsageTemplate()) + cmd.AddCommand(showEmailTemplateCmd(cli)) + cmd.AddCommand(updateEmailTemplateCmd(cli)) + return cmd +} + func showEmailTemplateCmd(cli *cli) *cobra.Command { var inputs struct { Template string @@ -106,8 +119,8 @@ func showEmailTemplateCmd(cli *cli) *cobra.Command { Args: cobra.MaximumNArgs(1), Short: "Show an email template", Long: "Show an email template.", - Example: `auth0 branding emails show