Documentation ¶
Index ¶
- func GenUUID() string
- func TimedDispatch(em *SendgridEmailSender)
- func XData(x ...interface{}) (rv string)
- type EmailSender
- type SendgridEmailSender
- func (em *SendgridEmailSender) GetCurTick() int
- func (em SendgridEmailSender) LogError(rowID, msg string, err error)
- func (em SendgridEmailSender) LogSuccess(rowID string)
- func (em *SendgridEmailSender) SendEmail(template_name string, param ...interface{}) (err error)
- func (em *SendgridEmailSender) SendEmailMapdata(template_name string, mdata map[string]interface{}) (err error)
- func (em *SendgridEmailSender) SendEmailViaVendor(...) (err error)
- func (em SendgridEmailSender) SqlRunStmt(stmt string, encPat string, data ...interface{}) (rv []map[string]interface{}, err error)
- func (em *SendgridEmailSender) TemplateAndSend()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimedDispatch ¶
func TimedDispatch(em *SendgridEmailSender)
Types ¶
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) }
func NewEmailSender ¶
func NewEmailSender(gcfg *data.BaseConfigType, db map[string]bool, f *os.File, conn *pgxpool.Pool, ctx context.Context, lgr *zap.Logger, xmd *metrics.MetricsData) (rv EmailSender)
type SendgridEmailSender ¶
type SendgridEmailSender struct { // Debug flags like prevent send of email for testing DbFlag map[string]bool // contains filtered or unexported fields }
func (*SendgridEmailSender) GetCurTick ¶
func (em *SendgridEmailSender) GetCurTick() int
GetCurTics returns the number of times that a timeout has saved the data.
func (SendgridEmailSender) LogError ¶
func (em SendgridEmailSender) 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 (SendgridEmailSender) LogSuccess ¶
func (em SendgridEmailSender) LogSuccess(rowID string)
-------------------------------------------------------------------------------------------------------------------------
func (*SendgridEmailSender) SendEmail ¶
func (em *SendgridEmailSender) 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 (*SendgridEmailSender) SendEmailMapdata ¶
func (em *SendgridEmailSender) SendEmailMapdata(template_name string, mdata map[string]interface{}) (err error)
func (*SendgridEmailSender) SendEmailViaVendor ¶
func (em *SendgridEmailSender) SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (err error)
-------------------------------------------------------------------------------------------------------------------------
func (SendgridEmailSender) SqlRunStmt ¶
func (em SendgridEmailSender) 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 (*SendgridEmailSender) TemplateAndSend ¶
func (em *SendgridEmailSender) TemplateAndSend()