feat: send email
This commit is contained in:
10
main.go
10
main.go
@@ -1,12 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const RESEND_API_KEY = "RESEND_API_KEY"
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "email",
|
||||
Short: "email is a command line interface for sending emails.",
|
||||
@@ -22,6 +25,13 @@ var rootCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func main() {
|
||||
key := os.Getenv(RESEND_API_KEY)
|
||||
if key == "" {
|
||||
fmt.Printf("\n %s %s %s\n\n", errorHeaderStyle.String(), inlineCodeStyle.Render(RESEND_API_KEY), "environment variable is required.")
|
||||
fmt.Printf(" %s %s\n\n", commentStyle.Render("You can grab one at"), linkStyle.Render("https://resend.com"))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
err := rootCmd.Execute()
|
||||
if err != nil {
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user