Documentation ¶
Index ¶
- Constants
- func BindFormOrJSON(c *gin.Context, bindTo interface{}) (err error)
- func GenUUID() string
- func TimedDispatch(em *GenericEmailSender)
- func XData(x ...interface{}) (rv string)
- type AwsSesEmailSender
- type EmailSender
- type EmailSenderImplementation
- type GenericEmailSender
- func (em *GenericEmailSender) GetCurTick() int
- func (em GenericEmailSender) LogError(rowID, msg string, err error)
- func (em GenericEmailSender) LogSuccess(rowID string)
- func (em *GenericEmailSender) ResetLogFile(newFp *os.File)
- func (em *GenericEmailSender) SendEmail(template_name string, param ...interface{}) (err error)
- func (em *GenericEmailSender) SendEmailMapdata(template_name string, mdata map[string]interface{}) (err error)
- func (em *GenericEmailSender) SendEmailViaVendor(...) (err error)
- func (em *GenericEmailSender) SetupHandlerApi(router *gin.Engine, urlPath, AuthKey string)
- func (em GenericEmailSender) SqlRunStmt(stmt string, encPat string, data ...interface{}) (rv []map[string]interface{}, err error)
- func (em *GenericEmailSender) TemplateAndSend()
- type SendgridEmailSender
Constants ¶
const (
// The character encoding for the email.
CharSet = "UTF-8"
)
Variables ¶
This section is empty.
Functions ¶
func BindFormOrJSON ¶ added in v1.0.40
func TimedDispatch ¶
func TimedDispatch(em *GenericEmailSender)
Types ¶
type AwsSesEmailSender ¶ added in v1.0.24
type AwsSesEmailSender struct {
// contains filtered or unexported fields
}
func (*AwsSesEmailSender) SendEmailViaVendor ¶ added in v1.0.24
func (em *AwsSesEmailSender) SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (error, string)
-------------------------------------------------------------------------------------------------------------------------
type EmailSender ¶
type EmailSender interface { SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (err error) SendEmail(template_name string, param ...interface{}) (err error) SendEmailMapdata(template_name string, mdata map[string]interface{}) (err error) LogError(rowID, msg string, err error) LogSuccess(rowID string) SetupHandlerApi(router *gin.Engine, urlPath, key string) ResetLogFile(newFp *os.File) }
func NewEmailSender ¶
func NewEmailSender(senderType string, gcfg *data.BaseConfigType, db map[string]bool, f *os.File, conn *pgxpool.Pool, ctx context.Context, lgr *zap.Logger, xmd *metrics.MetricsData) (rv EmailSender)
func NewEmailSender(senderType string, gcfg *data.BaseConfigType, db map[string]bool, f *os.File, conn *pgxpool.Pool, ctx context.Context, lgr *zap.Logger, xmd *metrics.MetricsData) (rv GenericEmailSender) {
type EmailSenderImplementation ¶ added in v1.0.24
type EmailSenderImplementation interface {
SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (err error, result string)
}
func NewEmailSenderAwsSes ¶ added in v1.0.24
func NewEmailSenderAwsSes(f *os.File) (rv EmailSenderImplementation)
func NewEmailSenderSendgrid ¶ added in v1.0.24
func NewEmailSenderSendgrid(f *os.File) (rv EmailSenderImplementation)
type GenericEmailSender ¶ added in v1.0.24
type GenericEmailSender struct { SenderName string TheSender EmailSenderImplementation // Debug flags like prevent send of email for testing DbFlag map[string]bool // contains filtered or unexported fields }
func (*GenericEmailSender) GetCurTick ¶ added in v1.0.24
func (em *GenericEmailSender) GetCurTick() int
GetCurTics returns the number of times that a timeout has saved the data.
func (GenericEmailSender) LogError ¶ added in v1.0.24
func (em GenericEmailSender) LogError(rowID, msg string, err error)
-------------------------------------------------------------------------------------------------------------------------
CREATE TABLE if not exists q_qr_email_log ( email_email_id uuid DEFAULT uuid_generate_v4() not null primary key , updated timestamp , created timestamp default current_timestamp not null , user_id uuid , state text , error_msg text , email_data text );
func (GenericEmailSender) LogSuccess ¶ added in v1.0.24
func (em GenericEmailSender) LogSuccess(rowID string)
func (*GenericEmailSender) ResetLogFile ¶ added in v1.0.40
func (em *GenericEmailSender) ResetLogFile(newFp *os.File)
func (*GenericEmailSender) SendEmail ¶ added in v1.0.24
func (em *GenericEmailSender) SendEmail(template_name string, param ...interface{}) (err error)
SendEmail combines a base template name with globacl configuration on where to find the templates and turns that into all the parts of an email, then calls SendEmailViaVendor to send the email.
func (*GenericEmailSender) SendEmailMapdata ¶ added in v1.0.24
func (em *GenericEmailSender) SendEmailMapdata(template_name string, mdata map[string]interface{}) (err error)
func (*GenericEmailSender) SendEmailViaVendor ¶ added in v1.0.24
func (em *GenericEmailSender) SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (err error)
SendEmailViaVendor will use the underlying implemenation to send the email.
func (*GenericEmailSender) SetupHandlerApi ¶ added in v1.0.40
func (em *GenericEmailSender) SetupHandlerApi(router *gin.Engine, urlPath, AuthKey string)
SetupHandlerApi will create a handler at the specified URL path to "kick" the timed sender
func (GenericEmailSender) SqlRunStmt ¶ added in v1.0.24
func (em GenericEmailSender) SqlRunStmt(stmt string, encPat string, data ...interface{}) (rv []map[string]interface{}, err error)
SqlRunStmt will run a single statemt and return the data as an array of maps
func (*GenericEmailSender) TemplateAndSend ¶ added in v1.0.24
func (em *GenericEmailSender) TemplateAndSend()
type SendgridEmailSender ¶
type SendgridEmailSender struct {
// contains filtered or unexported fields
}
func (*SendgridEmailSender) SendEmailViaVendor ¶
func (em *SendgridEmailSender) SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (err error, result string)
-------------------------------------------------------------------------------------------------------------------------