email

package
v0.0.0-...-3061286 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package email provides email sending capabilities for TurboScript.

This package supports multiple email drivers including SMTP, Mailgun, AWS SES, SendGrid, and Postmark. The driver is selected based on the configuration and can be overridden on a per-message basis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Filename    string `json:"filename"`
	Content     string `json:"content"` // base64 encoded
	ContentType string `json:"contentType,omitempty"`
}

Attachment represents an email attachment.

type Request

type Request struct {
	To          []string     `json:"to"`
	From        string       `json:"from,omitempty"`
	Subject     string       `json:"subject"`
	Content     string       `json:"content"`
	HTML        string       `json:"html,omitempty"`
	Driver      string       `json:"driver,omitempty"`
	CC          []string     `json:"cc,omitempty"`
	BCC         []string     `json:"bcc,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

Request represents an email to be sent.

type Service

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

Service provides email sending functionality.

func NewService

func NewService(cfg *config.EmailConfig) *Service

NewService creates a new email service instance.

func NewServiceWithServerConfig

func NewServiceWithServerConfig(cfg *config.EmailConfig, serverCfg *config.ServerConfig) *Service

NewServiceWithServerConfig creates a new email service instance with server configuration.

func (*Service) SendEmail

func (s *Service) SendEmail(req *Request) error

SendEmail sends an email using the configured driver.

Jump to

Keyboard shortcuts

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