email

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrevoProvider

type BrevoProvider struct {
	// contains filtered or unexported fields
}

BrevoProvider implements EmailProvider for Brevo

func NewBrevoProvider

func NewBrevoProvider(config *config.NotificationConfiguration) *BrevoProvider

NewBrevoProvider creates a new Brevo provider

func (*BrevoProvider) GetName

func (b *BrevoProvider) GetName() string

GetName returns the provider name

func (*BrevoProvider) SendEmail

SendEmail sends an email via Brevo

func (*BrevoProvider) SendTemplateEmail

func (b *BrevoProvider) SendTemplateEmail(ctx context.Context, payload types.SendEmailPayload, templateID string) (types.SendEmailResponse, error)

SendTemplateEmail sends a template email via Brevo

type EmailProvider

type EmailProvider interface {
	SendEmail(ctx context.Context, payload types.SendEmailPayload) (types.SendEmailResponse, error)
	SendTemplateEmail(ctx context.Context, payload types.SendEmailPayload, templateID string) (types.SendEmailResponse, error)
	GetName() string
}

EmailProvider defines the interface for email providers

type EmailService

type EmailService struct {
	// contains filtered or unexported fields
}

EmailService provides functionality for sending emails with provider abstraction and fallback support

func NewEmailService

func NewEmailService() *EmailService

NewEmailService creates a new EmailService with dynamic provider selection

func (*EmailService) SendEmail

SendEmail sends an email with fallback support

func (*EmailService) SendKYBApprovalEmail

func (e *EmailService) SendKYBApprovalEmail(ctx context.Context, email, firstName string) (types.SendEmailResponse, error)

SendKYBApprovalEmail sends a KYB approval email

func (*EmailService) SendKYBRejectionEmail

func (e *EmailService) SendKYBRejectionEmail(ctx context.Context, email, firstName, reasonForDecline string) (types.SendEmailResponse, error)

SendKYBRejectionEmail sends a KYB rejection email

func (*EmailService) SendPasswordResetEmail

func (e *EmailService) SendPasswordResetEmail(ctx context.Context, token, email, firstName string) (types.SendEmailResponse, error)

SendPasswordResetEmail sends a password reset email

func (*EmailService) SendTemplateEmail

func (e *EmailService) SendTemplateEmail(ctx context.Context, payload types.SendEmailPayload, templateID string) (types.SendEmailResponse, error)

SendTemplateEmail sends a template email with fallback support

func (*EmailService) SendVerificationEmail

func (e *EmailService) SendVerificationEmail(ctx context.Context, token, email, firstName string) (types.SendEmailResponse, error)

SendVerificationEmail sends a verification email

func (*EmailService) SendWebhookFailureEmail added in v0.0.3

func (e *EmailService) SendWebhookFailureEmail(ctx context.Context, email, firstName string) (types.SendEmailResponse, error)

SendWebhookFailureEmail sends a webhook failure notification email

func (*EmailService) SendWelcomeEmail

func (e *EmailService) SendWelcomeEmail(ctx context.Context, email, firstName string, scopes []string) (types.SendEmailResponse, error)

SendWelcomeEmail sends a welcome email

type EmailServiceInterface

type EmailServiceInterface interface {
	SendEmail(ctx context.Context, payload types.SendEmailPayload) (types.SendEmailResponse, error)
	SendTemplateEmail(ctx context.Context, payload types.SendEmailPayload, templateID string) (types.SendEmailResponse, error)
	SendVerificationEmail(ctx context.Context, token, email, firstName string) (types.SendEmailResponse, error)
	SendPasswordResetEmail(ctx context.Context, token, email, firstName string) (types.SendEmailResponse, error)
	SendWelcomeEmail(ctx context.Context, email, firstName string, scopes []string) (types.SendEmailResponse, error)
	SendKYBApprovalEmail(ctx context.Context, email, firstName string) (types.SendEmailResponse, error)
	SendKYBRejectionEmail(ctx context.Context, email, firstName, reasonForDecline string) (types.SendEmailResponse, error)
	SendWebhookFailureEmail(ctx context.Context, email, firstName string) (types.SendEmailResponse, error)
}

EmailServiceInterface provides the interface for the email service

func NewEmailServiceWithProviders

func NewEmailServiceWithProviders() EmailServiceInterface

NewEmailServiceWithProviders creates a new email service with dynamic provider selection

type MailgunProvider

type MailgunProvider struct {
	// contains filtered or unexported fields
}

MailgunProvider implements EmailProvider for Mailgun

func NewMailgunProvider

func NewMailgunProvider(config *config.NotificationConfiguration) *MailgunProvider

NewMailgunProvider creates a new Mailgun provider

func (*MailgunProvider) GetName

func (m *MailgunProvider) GetName() string

GetName returns the provider name

func (*MailgunProvider) SendEmail

SendEmail sends an email via Mailgun

func (*MailgunProvider) SendTemplateEmail

func (m *MailgunProvider) SendTemplateEmail(ctx context.Context, payload types.SendEmailPayload, templateID string) (types.SendEmailResponse, error)

SendTemplateEmail sends a template email via Mailgun

type ProviderFactory

type ProviderFactory struct {
	// contains filtered or unexported fields
}

ProviderFactory creates email providers based on configuration

func NewProviderFactory

func NewProviderFactory(config *config.NotificationConfiguration) *ProviderFactory

NewProviderFactory creates a new provider factory

func (*ProviderFactory) CreateProvider

func (pf *ProviderFactory) CreateProvider(providerName string) (EmailProvider, error)

CreateProvider creates an email provider based on the provider name

func (*ProviderFactory) GetDefaultProvider

func (pf *ProviderFactory) GetDefaultProvider() (EmailProvider, error)

GetDefaultProvider returns the default provider based on configuration

type SendGridProvider

type SendGridProvider struct {
	// contains filtered or unexported fields
}

SendGridProvider implements EmailProvider for SendGrid

func NewSendGridProvider

func NewSendGridProvider(config *config.NotificationConfiguration) *SendGridProvider

NewSendGridProvider creates a new SendGrid provider

func (*SendGridProvider) GetName

func (s *SendGridProvider) GetName() string

GetName returns the provider name

func (*SendGridProvider) SendEmail

SendEmail sends an email via SendGrid

func (*SendGridProvider) SendTemplateEmail

func (s *SendGridProvider) SendTemplateEmail(ctx context.Context, payload types.SendEmailPayload, templateID string) (types.SendEmailResponse, error)

SendTemplateEmail sends a template email via SendGrid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL