Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeEmailSend = "email:send" QueueTransactional = "transactional" QueueBulk = "bulk" QueueLow = "low" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmailSendHandler ¶
type EmailSendHandler struct {
// contains filtered or unexported fields
}
EmailSendHandler processes email:send tasks from the Asynq queue.
func NewEmailSendHandler ¶
func NewEmailSendHandler( emailRepo *repositories.EmailRepository, smtpRepo *repositories.SMTPRepository, serverRepo *repositories.ServerRepository, domainRepo *repositories.DomainRepository, contactRepo *repositories.ContactRepository, dispatcher *webhook.Dispatcher, ) *EmailSendHandler
func (*EmailSendHandler) OnFailed ¶
func (h *EmailSendHandler) OnFailed(fn func())
OnFailed sets a callback invoked after each permanently failed email send.
func (*EmailSendHandler) OnSent ¶
func (h *EmailSendHandler) OnSent(fn func())
OnSent sets a callback invoked after each successful email send.
func (*EmailSendHandler) ProcessTask ¶
ProcessTask handles an email:send task.
type EmailSendPayload ¶
type EmailSendPayload struct {
EmailID uint `json:"email_id"`
}
type ExhaustedErrorHandler ¶
type ExhaustedErrorHandler struct {
// contains filtered or unexported fields
}
ExhaustedErrorHandler marks emails as permanently failed when Asynq exhausts all retries. It implements asynq.ErrorHandler.
func NewExhaustedErrorHandler ¶
func NewExhaustedErrorHandler(emailRepo *repositories.EmailRepository, dispatcher *webhook.Dispatcher, onFailed func()) *ExhaustedErrorHandler
func (*ExhaustedErrorHandler) HandleError ¶
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer enqueues email tasks into Redis via Asynq.
func NewProducer ¶
func (*Producer) EnqueueEmailSend ¶
EnqueueEmailSend enqueues an email for background delivery.
Click to show internal directories.
Click to hide internal directories.