{"modulePath":"github.com/mycontroller-org/server/v2","version":"v2.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package email\n\n## Constants\n\n```go\nconst (\n\tTypeNone = \"\"\n\tTypeSMTP = \"smtp\"\n)\n```\nservice provider types\n\n```go\nconst (\n\tAuthTypePlain   = \"plain\"\n\tAuthTypeCRAMMD5 = \"crammd5\"\n)\n```\nauthentication options\n\n```go\nconst (\n\tPluginEmail = \"email\"\n)\n```\n\n## Functions\n\n```go\nfunc New(ctx context.Context, rawCfg *handlerTY.Config) (handlerTY.Plugin, error)\n```\nemail client\n\n## Types\n\n```go\ntype Client interface {\n\tName() string\n\tStart() error\n\tClose() error\n\tPost(variables map[string]interface{}) error\n\tState() *types.State\n\tSend(from string, to []string, subject, body string) error\n}\n```\nClient for email service\n\n```go\nfunc NewSMTPClient(ctx context.Context, logger *zap.Logger, handlerCfg *handlerTY.Config, cfg *Config) (Client, error)\n```\ninit smtp client\n\n```go\ntype Config struct {\n\tType      string\n\tHost      string\n\tPort      int\n\tAuthType  string\n\tUsername  string\n\tPassword  string `json:\"-\" yaml:\"-\"`\n\tFromEmail string\n\tToEmails  string // comma separated\n\tInsecure  bool\n}\n```\nConfig of email service\n\n```go\ntype SmtpClient struct {\n\t// contains filtered or unexported fields\n}\n```\nsmtp client\n\n```go\nfunc (sc *SmtpClient) Close() error\n```\nClose func implementation\n\n```go\nfunc (sc *SmtpClient) Name() string\n```\n\n```go\nfunc (sc *SmtpClient) Post(parameters map[string]interface{}) error\n```\nPost performs send operation\n\n```go\nfunc (sc *SmtpClient) Send(from string, to []string, subject, body string) error\n```\nSend func implementation\n\n```go\nfunc (sc *SmtpClient) Start() error\n```\n\n```go\nfunc (sc *SmtpClient) State() *types.State\n```\n\n","path":"github.com/mycontroller-org/server/v2/plugin/handler/email","name":"email","synopsis":"","isRedistributable":true}
