gomailer/cmd/inline.go

28 lines
571 B
Go
Raw Permalink Normal View History

2023-04-06 23:09:43 +00:00
package cmd
import (
2023-04-08 00:31:59 +00:00
"log"
2023-04-06 23:09:43 +00:00
"github.com/spf13/cobra"
2023-04-08 00:31:59 +00:00
"git.dafu.dev/dafu/gomailer/pkg"
2023-04-06 23:09:43 +00:00
)
// inlineCmd represents the send command
var inlineCmd = &cobra.Command{
2023-04-08 00:31:59 +00:00
Short: "Inline styles in template file without sending",
Long: `Inlines styles in given template and saves it to *_inlined.html`,
Args: cobra.MinimumNArgs(1),
Use: "inline [flags] [...template.html]",
2023-04-06 23:09:43 +00:00
Run: func(cmd *cobra.Command, args []string) {
2023-04-08 00:31:59 +00:00
log.Printf("Templates: %v", args)
for _, arg := range args {
gomailer.Inline(arg)
}
2023-04-06 23:09:43 +00:00
},
}
func init() {
rootCmd.AddCommand(inlineCmd)
}