gomailer/cmd/inline.go

28 lines
571 B
Go

package cmd
import (
"log"
"github.com/spf13/cobra"
"git.dafu.dev/dafu/gomailer/pkg"
)
// inlineCmd represents the send command
var inlineCmd = &cobra.Command{
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]",
Run: func(cmd *cobra.Command, args []string) {
log.Printf("Templates: %v", args)
for _, arg := range args {
gomailer.Inline(arg)
}
},
}
func init() {
rootCmd.AddCommand(inlineCmd)
}