Documentation
¶
Index ¶
- func GenUUID() string
- func XData(x ...interface{}) (rv string)
- type EmailSender
- type SendgridEmailSender
- func (this SendgridEmailSender) LogError(rowID, msg string, err error)
- func (this SendgridEmailSender) LogSuccess(rowID string)
- func (this *SendgridEmailSender) SendEmail(template_name string, param ...interface{}) (err error)
- func (this *SendgridEmailSender) SendEmailViaVendor(...) (err error)
- func (this SendgridEmailSender) SqlRunStmt(stmt string, encPat string, data ...interface{}) (rv []map[string]interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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)
LogError(rowID, msg string, err error)
LogSuccess(rowID string)
}
func NewEmailSender ¶
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) LogError ¶
func (this 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 (this SendgridEmailSender) LogSuccess(rowID string)
-------------------------------------------------------------------------------------------------------------------------
func (*SendgridEmailSender) SendEmail ¶
func (this *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) SendEmailViaVendor ¶
func (this *SendgridEmailSender) SendEmailViaVendor(rowID, fromName, fromAddress, subject, toName, toAddress, textBody, htmlBody string) (err error)
-------------------------------------------------------------------------------------------------------------------------
func (SendgridEmailSender) SqlRunStmt ¶
func (this 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