Use this template for your CLI project. Particularly suitable for a CI project.
This code contains a few files to get started on your CLI project. If you want more functionalities, it is better to use Confetti Framework.
Confetti Commands has extensive and thorough documentation, making it a breeze to get started.
package commands
import (
"src/app/mail_driver"
"github.com/confetti-framework/framework/inter"
"io"
)
type SendEmails struct {
Email string `flag:"email" required:"true"`
}
func (s SendEmails) Name() string {
return "mail:send"
}
func (s SendEmails) Description() string {
return "Send a marketing email to a user."
}
func (s SendEmails) Handle(c inter.Cli) inter.ExitCode {
mailer := mail_driver.DripEmailer{}
mailer.Send(s.Email)
c.Info("Email send to: %s", s.Email)
return inter.Success
}
Confetti is open-sourced software licensed under the MIT license.