Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const ResendAPIKey = "RESEND_API_KEY" //nolint:gosec

// PopFrom is the environment variable that sets the default "from" address.
const PopFrom = "POP_FROM"
const PopBcc = "POP_BCC"

// PopSignature is the environment variable that sets the default signature.
const PopSignature = "POP_SIGNATURE"
Expand Down Expand Up @@ -196,7 +197,12 @@ var ManCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(ManCmd)

rootCmd.Flags().StringSliceVar(&bcc, "bcc", []string{}, "BCC recipients")
bccValue := make([]string, 0, 1)
envBcc := os.Getenv(PopBcc)
if envBcc != "" {
bccValue = append(bccValue, envBcc)
}
rootCmd.Flags().StringSliceVar(&bcc, "bcc", bccValue, "BCC recipients"+commentStyle.Render("($"+PopBcc+")"))
rootCmd.Flags().StringSliceVar(&cc, "cc", []string{}, "CC recipients")
rootCmd.Flags().StringSliceVarP(&attachments, "attach", "a", []string{}, "Email's attachments")
rootCmd.Flags().StringSliceVarP(&to, "to", "t", []string{}, "Recipients")
Expand Down