sesv2

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 21 Imported by: 0

README

SES v2

Parity grade: A · SDK aws-sdk-go-v2/service/sesv2@v1.60.1 · last audited 2026-07-12 (7c297a53bedf9d9ba2f5af48da992b024774083f)

Coverage

Operations audited 110 (100 ok, 5 partial, 5 deferred)
Known gaps none
Deferred items 0
Resource leaks clean

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("NotFoundException")
	ErrAlreadyExists = errors.New("AlreadyExistsException")
	ErrInvalidInput  = errors.New("BadRequestException")
)

Errors returned by the SES v2 backend.

View Source
var (
	ErrIdentityNotFound       = ErrNotFound
	ErrIdentityAlreadyExists  = ErrAlreadyExists
	ErrConfigSetNotFound      = ErrNotFound
	ErrConfigSetAlreadyExists = ErrAlreadyExists
	ErrInvalidParameter       = ErrInvalidInput
)

Aliases for backward compatibility within the package.

View Source
var ErrNilAppContext = errors.New("sesv2: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AccountDetails

type AccountDetails struct {
	VdmAttributes         map[string]any `json:"vdmAttributes,omitempty"`
	MailType              string         `json:"mailType"`
	WebsiteURL            string         `json:"websiteURL"`
	ContactLanguage       string         `json:"contactLanguage"`
	UseCaseName           string         `json:"useCaseName"`
	SuppressionAttributes []string       `json:"suppressionAttributes,omitempty"`
	SendingEnabled        bool           `json:"sendingEnabled"`
	AutoWarmupEnabled     bool           `json:"autoWarmupEnabled,omitempty"`
}

AccountDetails stores account-level SESv2 settings.

type ArchivingOptions

type ArchivingOptions struct {
	ArchiveARN string `json:"archiveArn,omitempty"`
}

ArchivingOptions captures the archiving configuration of a configuration set.

type ConfigurationSet

type ConfigurationSet struct {
	CreatedAt                    time.Time         `json:"createdAt"`
	Name                         string            `json:"name"`
	Tags                         map[string]string `json:"tags,omitempty"`
	TrackingCustomRedirectDomain string            `json:"trackingCustomRedirectDomain,omitempty"`
	TrackingHTTPSPolicy          string            `json:"trackingHttpsPolicy,omitempty"`
	DeliveryTLSPolicy            string            `json:"deliveryTlsPolicy,omitempty"`
	DeliverySendingPoolName      string            `json:"deliverySendingPoolName,omitempty"`
	ArchivingOptions             *ArchivingOptions `json:"archivingOptions,omitempty"`
	VdmOptions                   *VdmOptions       `json:"vdmOptions,omitempty"`
	SuppressionReasons           []string          `json:"suppressionReasons,omitempty"`
	SendingEnabled               bool              `json:"sendingEnabled"`
	ReputationMetricsEnabled     bool              `json:"reputationMetricsEnabled"`
}

ConfigurationSet represents a SES v2 configuration set.

type Contact

type Contact struct {
	CreatedAt        time.Time         `json:"createdAt"`
	LastUpdatedAt    time.Time         `json:"lastUpdatedAt"`
	EmailAddress     string            `json:"emailAddress"`
	ContactListName  string            `json:"contactListName"`
	TopicPreferences []TopicPreference `json:"topicPreferences"`
	UnsubscribeAll   bool              `json:"unsubscribeAll"`
}

Contact represents a contact in a contact list.

type ContactList

type ContactList struct {
	CreatedAt     time.Time         `json:"createdAt"`
	LastUpdatedAt time.Time         `json:"lastUpdatedAt"`
	Tags          map[string]string `json:"tags"`
	Name          string            `json:"name"`
	Description   string            `json:"description"`
}

ContactList represents a SES v2 contact list.

type CustomVerificationEmailTemplate

type CustomVerificationEmailTemplate struct {
	TemplateName          string `json:"templateName"`
	FromEmailAddress      string `json:"fromEmailAddress"`
	TemplateSubject       string `json:"templateSubject"`
	TemplateContent       string `json:"templateContent"`
	SuccessRedirectionURL string `json:"successRedirectionURL"`
	FailureRedirectionURL string `json:"failureRedirectionURL"`
}

CustomVerificationEmailTemplate represents a custom verification email template.

type DedicatedIP

type DedicatedIP struct {
	IP               string `json:"ip"`
	PoolName         string `json:"poolName,omitempty"`
	WarmupStatus     string `json:"warmupStatus"`
	WarmupPercentage int    `json:"warmupPercentage"`
}

DedicatedIP represents a single dedicated IP address and its pool/warmup state.

type DedicatedIPPool

type DedicatedIPPool struct {
	PoolName    string `json:"poolName"`
	ScalingMode string `json:"scalingMode"`
}

DedicatedIPPool represents a SES v2 dedicated IP pool.

type DeliverabilityTestReport

type DeliverabilityTestReport struct {
	CreateDate               time.Time `json:"createDate"`
	ReportID                 string    `json:"reportId"`
	ReportName               string    `json:"reportName"`
	FromEmailAddress         string    `json:"fromEmailAddress"`
	DeliverabilityTestStatus string    `json:"deliverabilityTestStatus"`
}

DeliverabilityTestReport represents a deliverability test report.

type Email

type Email struct {
	Timestamp time.Time `json:"timestamp"`
	From      string    `json:"from"`
	Subject   string    `json:"subject"`
	BodyHTML  string    `json:"bodyHTML"`
	BodyText  string    `json:"bodyText"`
	MessageID string    `json:"messageID"`
	To        []string  `json:"to"`
}

Email captures a sent email for local inspection.

type EmailIdentity

type EmailIdentity struct {
	Tags                 map[string]string `json:"tags,omitempty"`
	Identity             string            `json:"identity"`
	IdentityType         string            `json:"identityType"`
	ConfigurationSetName string            `json:"configurationSetName,omitempty"`
	MailFromDomain       string            `json:"mailFromDomain,omitempty"`
	MailFromDomainStatus string            `json:"mailFromDomainStatus,omitempty"`
	BehaviorOnMxFailure  string            `json:"behaviorOnMxFailure,omitempty"`
	VerificationStatus   string            `json:"verificationStatus"`
	DkimStatus           string            `json:"dkimStatus"`
	DkimTokens           []string          `json:"dkimTokens,omitempty"`
	VerifiedForSending   bool              `json:"verifiedForSending"`
	FeedbackForwarding   bool              `json:"feedbackForwarding"`
	DkimSigningEnabled   bool              `json:"dkimSigningEnabled"`
}

EmailIdentity represents a verified email address or domain identity.

type EmailTemplate

type EmailTemplate struct {
	CreatedAt       time.Time             `json:"createdAt"`
	TemplateContent *EmailTemplateContent `json:"templateContent"`
	TemplateName    string                `json:"templateName"`
}

EmailTemplate represents a SES v2 email template.

type EmailTemplateContent

type EmailTemplateContent struct {
	Subject string `json:"subject"`
	Text    string `json:"text"`
	HTML    string `json:"html"`
}

EmailTemplateContent holds the content for an email template.

type EventDestination

type EventDestination struct {
	CreatedAt            time.Time `json:"createdAt"`
	Name                 string    `json:"name"`
	ConfigurationSetName string    `json:"configurationSetName"`
	MatchingEventTypes   []string  `json:"matchingEventTypes"`
	Enabled              bool      `json:"enabled"`
}

EventDestination represents an event destination for a configuration set.

type ExportJob

type ExportJob struct {
	CreatedAt time.Time `json:"createdAt"`
	JobID     string    `json:"jobId"`
	JobStatus string    `json:"jobStatus"`
}

ExportJob represents a SES v2 export job (minimal model for CancelExportJob).

type Handler

type Handler struct {
	Backend StorageBackend
}

Handler is the Echo HTTP handler for SES v2 operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new SES v2 handler with the given backend.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this SES v2 instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the SES v2 operation from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the identity or config set name from the request path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported SES v2 operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for SES v2 requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority for the SES v2 handler. Uses PriorityPathVersioned (85) since it matches a versioned path prefix.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset resets the backend state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches SES v2 REST requests. SES v2 requests use the /v2/email/ path prefix.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type ImportJob

type ImportJob struct {
	CreatedAt time.Time `json:"createdAt"`
	JobID     string    `json:"jobId"`
	JobStatus string    `json:"jobStatus"`
}

ImportJob stores an import job.

type InMemoryBackend

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

InMemoryBackend is an in-memory store for SES v2 email identities, emails, and configuration sets.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func NewInMemoryBackendWithConfig

func NewInMemoryBackendWithConfig(cfg *config.GlobalConfig) *InMemoryBackend

NewInMemoryBackendWithConfig creates a new InMemoryBackend with the given config.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the backend's AWS account ID.

func (*InMemoryBackend) AddContactListInternal

func (b *InMemoryBackend) AddContactListInternal(name string) *ContactList

AddContactListInternal creates a contact list directly (for tests).

func (*InMemoryBackend) AddExportJobInternal

func (b *InMemoryBackend) AddExportJobInternal(jobID, status string) *ExportJob

AddExportJobInternal creates an export job directly (for tests).

func (*InMemoryBackend) BatchGetMetricData

func (b *InMemoryBackend) BatchGetMetricData(
	queries []MetricDataQuery,
) ([]MetricDataResult, error)

BatchGetMetricData returns synthetic empty results for each query.

func (*InMemoryBackend) CancelExportJob

func (b *InMemoryBackend) CancelExportJob(jobID string) error

CancelExportJob sets an export job status to CANCELLED.

func (*InMemoryBackend) CreateConfigurationSet

func (b *InMemoryBackend) CreateConfigurationSet(name string) (*ConfigurationSet, error)

CreateConfigurationSet creates a new configuration set.

func (*InMemoryBackend) CreateConfigurationSetEventDestination

func (b *InMemoryBackend) CreateConfigurationSetEventDestination(
	configSetName, destName string,
	enabled bool,
	matchingEventTypes []string,
) (*EventDestination, error)

CreateConfigurationSetEventDestination adds an event destination to a configuration set.

func (*InMemoryBackend) CreateContact

func (b *InMemoryBackend) CreateContact(
	contactListName, emailAddress string,
	topicPreferences []TopicPreference,
) (*Contact, error)

CreateContact adds a contact to a contact list.

func (*InMemoryBackend) CreateContactList

func (b *InMemoryBackend) CreateContactList(name, description string) (*ContactList, error)

CreateContactList creates a new contact list.

func (*InMemoryBackend) CreateCustomVerificationEmailTemplate

func (b *InMemoryBackend) CreateCustomVerificationEmailTemplate(
	in *CustomVerificationEmailTemplate,
) (*CustomVerificationEmailTemplate, error)

CreateCustomVerificationEmailTemplate creates a custom verification email template.

func (*InMemoryBackend) CreateDedicatedIPPool

func (b *InMemoryBackend) CreateDedicatedIPPool(
	poolName, scalingMode string,
) (*DedicatedIPPool, error)

CreateDedicatedIPPool creates a dedicated IP pool.

func (*InMemoryBackend) CreateDeliverabilityTestReport

func (b *InMemoryBackend) CreateDeliverabilityTestReport(
	reportName, fromEmailAddress string,
) (*DeliverabilityTestReport, error)

CreateDeliverabilityTestReport creates a deliverability test report.

func (*InMemoryBackend) CreateEmailIdentity

func (b *InMemoryBackend) CreateEmailIdentity(
	identity, configurationSetName string,
	tags map[string]string,
) (*EmailIdentity, error)

CreateEmailIdentity creates a new email identity and marks it as verified.

func (*InMemoryBackend) CreateEmailIdentityPolicy

func (b *InMemoryBackend) CreateEmailIdentityPolicy(identity, policyName, policy string) error

CreateEmailIdentityPolicy creates a policy for an email identity.

func (*InMemoryBackend) CreateEmailTemplate

func (b *InMemoryBackend) CreateEmailTemplate(
	templateName string,
	content *EmailTemplateContent,
) (*EmailTemplate, error)

CreateEmailTemplate creates a new email template.

func (*InMemoryBackend) CreateExportJob

func (b *InMemoryBackend) CreateExportJob(dataSource string) (*ExportJob, error)

CreateExportJob creates a new export job.

func (*InMemoryBackend) CreateImportJob

func (b *InMemoryBackend) CreateImportJob(dataSource string) (*ImportJob, error)

CreateImportJob creates an import job.

func (*InMemoryBackend) CreateMultiRegionEndpoint

func (b *InMemoryBackend) CreateMultiRegionEndpoint(endpointName string) (string, error)

func (*InMemoryBackend) CreateTenant

func (b *InMemoryBackend) CreateTenant(tenantName string) (map[string]any, error)

func (*InMemoryBackend) CreateTenantResourceAssociation

func (b *InMemoryBackend) CreateTenantResourceAssociation(tenantName, resourceArn string) error

func (*InMemoryBackend) DeleteConfigurationSet

func (b *InMemoryBackend) DeleteConfigurationSet(name string) error

DeleteConfigurationSet removes a configuration set and its event destinations.

func (*InMemoryBackend) DeleteConfigurationSetEventDestination

func (b *InMemoryBackend) DeleteConfigurationSetEventDestination(
	configSetName, destName string,
) error

DeleteConfigurationSetEventDestination removes an event destination.

func (*InMemoryBackend) DeleteContact

func (b *InMemoryBackend) DeleteContact(contactListName, emailAddress string) error

DeleteContact removes a contact from a contact list.

func (*InMemoryBackend) DeleteContactList

func (b *InMemoryBackend) DeleteContactList(name string) error

DeleteContactList removes a contact list and all its contacts.

func (*InMemoryBackend) DeleteCustomVerificationEmailTemplate

func (b *InMemoryBackend) DeleteCustomVerificationEmailTemplate(name string) error

DeleteCustomVerificationEmailTemplate removes a custom verification template.

func (*InMemoryBackend) DeleteDedicatedIPPool

func (b *InMemoryBackend) DeleteDedicatedIPPool(poolName string) error

DeleteDedicatedIPPool removes a dedicated IP pool.

func (*InMemoryBackend) DeleteEmailIdentity

func (b *InMemoryBackend) DeleteEmailIdentity(identity string) error

DeleteEmailIdentity removes an email identity.

func (*InMemoryBackend) DeleteEmailIdentityPolicy

func (b *InMemoryBackend) DeleteEmailIdentityPolicy(identity, policyName string) error

DeleteEmailIdentityPolicy deletes a policy from an identity.

func (*InMemoryBackend) DeleteEmailTemplate

func (b *InMemoryBackend) DeleteEmailTemplate(name string) error

DeleteEmailTemplate removes a template.

func (*InMemoryBackend) DeleteMultiRegionEndpoint

func (b *InMemoryBackend) DeleteMultiRegionEndpoint(endpointName string) error

func (*InMemoryBackend) DeleteSuppressedDestination

func (b *InMemoryBackend) DeleteSuppressedDestination(email string) error

DeleteSuppressedDestination removes a suppressed destination.

func (*InMemoryBackend) DeleteTenant

func (b *InMemoryBackend) DeleteTenant(tenantName string) error

func (*InMemoryBackend) DeleteTenantResourceAssociation

func (b *InMemoryBackend) DeleteTenantResourceAssociation(tenantName, resourceArn string) error

func (*InMemoryBackend) GetAccount

func (b *InMemoryBackend) GetAccount() (*AccountDetails, error)

GetAccount returns the account details.

func (*InMemoryBackend) GetBlacklistReports

func (b *InMemoryBackend) GetBlacklistReports() (map[string][]string, error)

GetBlacklistReports returns empty blacklist reports.

func (*InMemoryBackend) GetConfigurationSet

func (b *InMemoryBackend) GetConfigurationSet(name string) (*ConfigurationSet, error)

GetConfigurationSet returns the configuration set with the given name.

func (*InMemoryBackend) GetConfigurationSetEventDestinations

func (b *InMemoryBackend) GetConfigurationSetEventDestinations(
	configSetName string,
) ([]*EventDestination, error)

GetConfigurationSetEventDestinations retrieves event destinations for a config set.

func (*InMemoryBackend) GetContact

func (b *InMemoryBackend) GetContact(contactListName, emailAddress string) (*Contact, error)

GetContact retrieves a contact from a contact list.

func (*InMemoryBackend) GetContactList

func (b *InMemoryBackend) GetContactList(name string) (*ContactList, error)

GetContactList retrieves a contact list.

func (*InMemoryBackend) GetCustomVerificationEmailTemplate

func (b *InMemoryBackend) GetCustomVerificationEmailTemplate(
	name string,
) (*CustomVerificationEmailTemplate, error)

GetCustomVerificationEmailTemplate retrieves a custom verification template.

func (*InMemoryBackend) GetDedicatedIP

func (b *InMemoryBackend) GetDedicatedIP(ip string) (map[string]any, error)

GetDedicatedIP returns the stored dedicated IP attributes. IPs that have never been assigned to a pool or warmed up are reported as fully warmed up, matching the prior stub behaviour for IPs SES manages implicitly.

func (*InMemoryBackend) GetDedicatedIPPool

func (b *InMemoryBackend) GetDedicatedIPPool(poolName string) (*DedicatedIPPool, error)

GetDedicatedIPPool retrieves a dedicated IP pool.

func (*InMemoryBackend) GetDedicatedIps

func (b *InMemoryBackend) GetDedicatedIps() []map[string]any

GetDedicatedIps returns all tracked dedicated IPs.

func (*InMemoryBackend) GetDeliverabilityDashboardOptions

func (b *InMemoryBackend) GetDeliverabilityDashboardOptions() (map[string]any, error)

GetDeliverabilityDashboardOptions returns stub options.

func (*InMemoryBackend) GetDeliverabilityTestReport

func (b *InMemoryBackend) GetDeliverabilityTestReport(
	reportID string,
) (*DeliverabilityTestReport, error)

GetDeliverabilityTestReport retrieves a test report.

func (*InMemoryBackend) GetDomainDeliverabilityCampaign

func (b *InMemoryBackend) GetDomainDeliverabilityCampaign(domain, campaignID string) (map[string]any, error)

func (*InMemoryBackend) GetDomainStatisticsReport

func (b *InMemoryBackend) GetDomainStatisticsReport(domain, startDate, endDate string) (map[string]any, error)

func (*InMemoryBackend) GetEmailAddressInsights

func (b *InMemoryBackend) GetEmailAddressInsights(_ string) (map[string]any, error)

GetEmailAddressInsights returns a stub.

func (*InMemoryBackend) GetEmailIdentity

func (b *InMemoryBackend) GetEmailIdentity(identity string) (*EmailIdentity, error)

GetEmailIdentity returns the email identity with the given name.

func (*InMemoryBackend) GetEmailIdentityPolicies

func (b *InMemoryBackend) GetEmailIdentityPolicies(identity string) (map[string]string, error)

GetEmailIdentityPolicies returns policies for an identity.

func (*InMemoryBackend) GetEmailTemplate

func (b *InMemoryBackend) GetEmailTemplate(name string) (*EmailTemplate, error)

GetEmailTemplate retrieves a template.

func (*InMemoryBackend) GetExportJob

func (b *InMemoryBackend) GetExportJob(jobID string) (*ExportJob, error)

GetExportJob retrieves an export job.

func (*InMemoryBackend) GetImportJob

func (b *InMemoryBackend) GetImportJob(jobID string) (*ImportJob, error)

GetImportJob retrieves an import job.

func (*InMemoryBackend) GetMessageInsights

func (b *InMemoryBackend) GetMessageInsights(_ string) (map[string]any, error)

GetMessageInsights returns a stub.

func (*InMemoryBackend) GetMultiRegionEndpoint

func (b *InMemoryBackend) GetMultiRegionEndpoint(endpointName string) (map[string]any, error)

func (*InMemoryBackend) GetReputationEntity

func (b *InMemoryBackend) GetReputationEntity(entityID string) (map[string]any, error)

GetReputationEntity returns the stored reputation entity attributes. Entities in SES exist implicitly for every configuration set and identity, so an entity that has never been updated is reported with its reference and no overrides rather than as not-found.

func (*InMemoryBackend) GetSuppressedDestination

func (b *InMemoryBackend) GetSuppressedDestination(email string) (*SuppressedDestination, error)

GetSuppressedDestination retrieves a suppressed destination.

func (*InMemoryBackend) GetTenant

func (b *InMemoryBackend) GetTenant(tenantName string) (map[string]any, error)

func (*InMemoryBackend) ListConfigurationSets

func (b *InMemoryBackend) ListConfigurationSets(
	nextToken string,
	pageSize int,
) page.Page[*ConfigurationSet]

ListConfigurationSets returns a paginated, sorted list of configuration sets.

func (*InMemoryBackend) ListContactLists

func (b *InMemoryBackend) ListContactLists(nextToken string, pageSize int) page.Page[*ContactList]

ListContactLists returns all contact lists.

func (*InMemoryBackend) ListContacts

func (b *InMemoryBackend) ListContacts(
	contactListName, nextToken string,
	pageSize int,
) (page.Page[*Contact], error)

ListContacts returns all contacts in a contact list.

func (*InMemoryBackend) ListCustomVerificationEmailTemplates

func (b *InMemoryBackend) ListCustomVerificationEmailTemplates(
	nextToken string,
	pageSize int,
) page.Page[*CustomVerificationEmailTemplate]

ListCustomVerificationEmailTemplates returns all custom verification templates.

func (*InMemoryBackend) ListDedicatedIPPools

func (b *InMemoryBackend) ListDedicatedIPPools(nextToken string, pageSize int) page.Page[string]

ListDedicatedIPPools returns all dedicated IP pool names.

func (*InMemoryBackend) ListDeliverabilityTestReports

func (b *InMemoryBackend) ListDeliverabilityTestReports(
	nextToken string,
	pageSize int,
) page.Page[*DeliverabilityTestReport]

ListDeliverabilityTestReports lists all test reports.

func (*InMemoryBackend) ListDomainDeliverabilityCampaigns

func (b *InMemoryBackend) ListDomainDeliverabilityCampaigns(
	_, _, _, _ string,
) ([]map[string]any, string, error)

ListDomainDeliverabilityCampaigns returns empty list.

func (*InMemoryBackend) ListEmailIdentities

func (b *InMemoryBackend) ListEmailIdentities(
	nextToken string,
	pageSize int,
) page.Page[*EmailIdentity]

ListEmailIdentities returns a paginated, sorted list of email identities.

func (*InMemoryBackend) ListEmailTemplates

func (b *InMemoryBackend) ListEmailTemplates(
	nextToken string,
	pageSize int,
) page.Page[*EmailTemplate]

ListEmailTemplates returns all email templates.

func (*InMemoryBackend) ListEmails

func (b *InMemoryBackend) ListEmails() []Email

ListEmails returns a copy of all captured emails.

func (*InMemoryBackend) ListExportJobs

func (b *InMemoryBackend) ListExportJobs(nextToken string, pageSize int) page.Page[*ExportJob]

ListExportJobs returns all export jobs.

func (*InMemoryBackend) ListImportJobs

func (b *InMemoryBackend) ListImportJobs(nextToken string, pageSize int) page.Page[*ImportJob]

ListImportJobs returns all import jobs.

func (*InMemoryBackend) ListMultiRegionEndpoints

func (b *InMemoryBackend) ListMultiRegionEndpoints(
	nextToken string,
	pageSize int,
) ([]map[string]any, string, error)

func (*InMemoryBackend) ListRecommendations

func (b *InMemoryBackend) ListRecommendations(_ string, _ int) ([]map[string]any, string, error)

ListRecommendations returns empty list.

func (*InMemoryBackend) ListReputationEntities

func (b *InMemoryBackend) ListReputationEntities(
	_ string,
	_ int,
) ([]map[string]any, string, error)

ListReputationEntities returns all tracked reputation entities.

func (*InMemoryBackend) ListResourceTenants

func (b *InMemoryBackend) ListResourceTenants(
	resourceArn string,
	_ int,
) ([]map[string]any, string, error)

func (*InMemoryBackend) ListSuppressedDestinations

func (b *InMemoryBackend) ListSuppressedDestinations(
	nextToken string,
	pageSize int,
) page.Page[*SuppressedDestination]

ListSuppressedDestinations lists all suppressed destinations.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(arn string) (map[string]string, error)

func (*InMemoryBackend) ListTenantResources

func (b *InMemoryBackend) ListTenantResources(
	tenantName string,
	_ int,
) ([]map[string]any, string, error)

func (*InMemoryBackend) ListTenants

func (b *InMemoryBackend) ListTenants(nextToken string, pageSize int) ([]map[string]any, string, error)

func (*InMemoryBackend) PutAccountDedicatedIPWarmupAttributes

func (b *InMemoryBackend) PutAccountDedicatedIPWarmupAttributes(autoWarmupEnabled bool) error

func (*InMemoryBackend) PutAccountDetails

func (b *InMemoryBackend) PutAccountDetails(details *AccountDetails) error

PutAccountDetails stores account details.

func (*InMemoryBackend) PutAccountSendingAttributes

func (b *InMemoryBackend) PutAccountSendingAttributes(sendingEnabled bool) error

PutAccountSendingAttributes sets the sending enabled flag.

func (*InMemoryBackend) PutAccountSuppressionAttributes

func (b *InMemoryBackend) PutAccountSuppressionAttributes(suppressedReasons []string) error

func (*InMemoryBackend) PutAccountVdmAttributes

func (b *InMemoryBackend) PutAccountVdmAttributes(vdmAttributes map[string]any) error

func (*InMemoryBackend) PutConfigurationSetArchivingOptions

func (b *InMemoryBackend) PutConfigurationSetArchivingOptions(name, archiveARN string) error

PutConfigurationSetArchivingOptions stores the archive ARN on the config set.

func (*InMemoryBackend) PutConfigurationSetDeliveryOptions

func (b *InMemoryBackend) PutConfigurationSetDeliveryOptions(
	name, tlsPolicy, sendingPoolName string,
) error

PutConfigurationSetDeliveryOptions stores the TLS policy and sending pool name.

func (*InMemoryBackend) PutConfigurationSetReputationOptions

func (b *InMemoryBackend) PutConfigurationSetReputationOptions(
	name string,
	metricsEnabled bool,
) error

PutConfigurationSetReputationOptions stores the reputation metrics flag.

func (*InMemoryBackend) PutConfigurationSetSendingOptions

func (b *InMemoryBackend) PutConfigurationSetSendingOptions(
	name string,
	sendingEnabled bool,
) error

PutConfigurationSetSendingOptions enables or disables sending for the config set.

func (*InMemoryBackend) PutConfigurationSetSuppressionOptions

func (b *InMemoryBackend) PutConfigurationSetSuppressionOptions(
	name string,
	suppressedReasons []string,
) error

PutConfigurationSetSuppressionOptions stores the suppression reason list.

func (*InMemoryBackend) PutConfigurationSetTrackingOptions

func (b *InMemoryBackend) PutConfigurationSetTrackingOptions(
	name, customRedirectDomain, httpsPolicy string,
) error

PutConfigurationSetTrackingOptions stores the custom redirect domain and HTTPS policy.

func (*InMemoryBackend) PutConfigurationSetVdmOptions

func (b *InMemoryBackend) PutConfigurationSetVdmOptions(
	name string,
	dashboardOptions, guardianOptions map[string]any,
) error

PutConfigurationSetVdmOptions stores the VDM options on the config set.

func (*InMemoryBackend) PutDedicatedIPInPool

func (b *InMemoryBackend) PutDedicatedIPInPool(ip, poolName string) error

PutDedicatedIPInPool moves a dedicated IP into the requested pool. The destination pool must exist.

func (*InMemoryBackend) PutDedicatedIPPoolScalingAttributes

func (b *InMemoryBackend) PutDedicatedIPPoolScalingAttributes(poolName, scalingMode string) error

PutDedicatedIPPoolScalingAttributes updates a pool's scaling mode.

func (*InMemoryBackend) PutDedicatedIPWarmupAttributes

func (b *InMemoryBackend) PutDedicatedIPWarmupAttributes(ip string, warmupPercentage int) error

PutDedicatedIPWarmupAttributes records the warmup percentage for a dedicated IP and derives the warmup status from it.

func (*InMemoryBackend) PutDeliverabilityDashboardOption

func (b *InMemoryBackend) PutDeliverabilityDashboardOption() error

PutDeliverabilityDashboardOption is a no-op stub.

func (*InMemoryBackend) PutEmailIdentityConfigurationSetAttributes

func (b *InMemoryBackend) PutEmailIdentityConfigurationSetAttributes(
	identity, configSetName string,
) error

PutEmailIdentityConfigurationSetAttributes associates a configuration set with the identity.

func (*InMemoryBackend) PutEmailIdentityDkimAttributes

func (b *InMemoryBackend) PutEmailIdentityDkimAttributes(
	identity string,
	signingEnabled bool,
) error

PutEmailIdentityDkimAttributes enables or disables DKIM signing for the identity.

func (*InMemoryBackend) PutEmailIdentityDkimSigningAttributes

func (b *InMemoryBackend) PutEmailIdentityDkimSigningAttributes(identity string) error

PutEmailIdentityDkimSigningAttributes validates the identity exists (BYODKIM not modelled).

func (*InMemoryBackend) PutEmailIdentityFeedbackAttributes

func (b *InMemoryBackend) PutEmailIdentityFeedbackAttributes(
	identity string,
	emailForwardingEnabled bool,
) error

PutEmailIdentityFeedbackAttributes sets the feedback forwarding flag for the identity.

func (*InMemoryBackend) PutEmailIdentityMailFromAttributes

func (b *InMemoryBackend) PutEmailIdentityMailFromAttributes(
	identity, mailFromDomain, behaviorOnMxFailure string,
) error

PutEmailIdentityMailFromAttributes stores the custom MAIL FROM domain and failure behaviour.

func (*InMemoryBackend) PutSuppressedDestination

func (b *InMemoryBackend) PutSuppressedDestination(email, reason string) error

PutSuppressedDestination adds or updates a suppressed destination.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the backend's AWS region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset closes the mutex and re-initialises all state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) SendBulkEmail

func (b *InMemoryBackend) SendBulkEmail(
	fromEmailAddress string,
	bulkEmailEntries []map[string]any,
) ([]map[string]any, error)

SendBulkEmail sends bulk emails — records sent emails with actual recipients.

func (*InMemoryBackend) SendCustomVerificationEmail

func (b *InMemoryBackend) SendCustomVerificationEmail(
	emailAddress, templateName string,
) (string, error)

SendCustomVerificationEmail sends a custom verification email (stub).

func (*InMemoryBackend) SendEmail

func (b *InMemoryBackend) SendEmail(
	from string,
	to []string,
	subject, bodyHTML, bodyText string,
) (string, error)

SendEmail captures an outbound email and returns a message ID.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(arn string, tags map[string]string) error

func (*InMemoryBackend) TestRenderEmailTemplate

func (b *InMemoryBackend) TestRenderEmailTemplate(name, templateData string) (string, error)

TestRenderEmailTemplate renders a template with merge data.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(arn string, tagKeys []string) error

func (*InMemoryBackend) UpdateConfigurationSetEventDestination

func (b *InMemoryBackend) UpdateConfigurationSetEventDestination(
	configSetName, destName string,
	enabled bool,
	matchingEventTypes []string,
) error

UpdateConfigurationSetEventDestination updates an event destination.

func (*InMemoryBackend) UpdateContact

func (b *InMemoryBackend) UpdateContact(
	contactListName, emailAddress string,
	topicPreferences []TopicPreference,
) error

UpdateContact updates a contact's topic preferences.

func (*InMemoryBackend) UpdateContactList

func (b *InMemoryBackend) UpdateContactList(name, description string) error

UpdateContactList updates a contact list description.

func (*InMemoryBackend) UpdateCustomVerificationEmailTemplate

func (b *InMemoryBackend) UpdateCustomVerificationEmailTemplate(
	in *CustomVerificationEmailTemplate,
) error

UpdateCustomVerificationEmailTemplate updates a custom verification template.

func (*InMemoryBackend) UpdateEmailIdentityPolicy

func (b *InMemoryBackend) UpdateEmailIdentityPolicy(identity, policyName, policy string) error

UpdateEmailIdentityPolicy updates a policy for an identity.

func (*InMemoryBackend) UpdateEmailTemplate

func (b *InMemoryBackend) UpdateEmailTemplate(name string, content *EmailTemplateContent) error

UpdateEmailTemplate updates a template.

func (*InMemoryBackend) UpdateReputationEntityCustomerManagedStatus

func (b *InMemoryBackend) UpdateReputationEntityCustomerManagedStatus(
	entityID, status string,
) error

UpdateReputationEntityCustomerManagedStatus stores the customer-managed status.

func (*InMemoryBackend) UpdateReputationEntityPolicy

func (b *InMemoryBackend) UpdateReputationEntityPolicy(entityID, policy string) error

UpdateReputationEntityPolicy stores the reputation management policy.

type MetricDataQuery

type MetricDataQuery struct {
	ID        string `json:"id"`
	Namespace string `json:"namespace"`
	Metric    string `json:"metric"`
}

MetricDataQuery represents a single query for BatchGetMetricData.

type MetricDataResult

type MetricDataResult struct {
	ID         string      `json:"id"`
	Timestamps []time.Time `json:"timestamps"`
	Values     []float64   `json:"values"`
}

MetricDataResult is the result for a single metric query.

type Provider

type Provider struct{}

Provider implements service.Provider for the SES v2 service.

func (*Provider) Init

func (p *Provider) Init(appCtx *service.AppContext) (service.Registerable, error)

Init initializes the SES v2 service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type ReputationEntity

type ReputationEntity struct {
	EntityRef             string `json:"entityRef"`
	EntityType            string `json:"entityType,omitempty"`
	CustomerManagedStatus string `json:"customerManagedStatus,omitempty"`
	ReputationPolicy      string `json:"reputationPolicy,omitempty"`
}

ReputationEntity represents a SES v2 reputation entity (e.g. a configuration set or email identity tracked for reputation purposes).

type StorageBackend

type StorageBackend interface {
	// Core identity ops
	CreateEmailIdentity(identity, configurationSetName string, tags map[string]string) (*EmailIdentity, error)
	GetEmailIdentity(identity string) (*EmailIdentity, error)
	ListEmailIdentities(nextToken string, pageSize int) page.Page[*EmailIdentity]
	DeleteEmailIdentity(identity string) error

	// Email identity policy ops
	CreateEmailIdentityPolicy(identity, policyName, policy string) error
	GetEmailIdentityPolicies(identity string) (map[string]string, error)
	DeleteEmailIdentityPolicy(identity, policyName string) error
	UpdateEmailIdentityPolicy(identity, policyName, policy string) error

	// Email identity attribute ops
	PutEmailIdentityConfigurationSetAttributes(identity, configSetName string) error
	PutEmailIdentityDkimAttributes(identity string, signingEnabled bool) error
	PutEmailIdentityDkimSigningAttributes(identity string) error
	PutEmailIdentityFeedbackAttributes(identity string, emailForwardingEnabled bool) error
	PutEmailIdentityMailFromAttributes(identity, mailFromDomain, behaviorOnMxFailure string) error

	// Configuration set ops
	CreateConfigurationSet(name string) (*ConfigurationSet, error)
	GetConfigurationSet(name string) (*ConfigurationSet, error)
	ListConfigurationSets(nextToken string, pageSize int) page.Page[*ConfigurationSet]
	DeleteConfigurationSet(name string) error

	// Configuration set attribute ops
	PutConfigurationSetArchivingOptions(name, archiveARN string) error
	PutConfigurationSetDeliveryOptions(name, tlsPolicy, sendingPoolName string) error
	PutConfigurationSetReputationOptions(name string, metricsEnabled bool) error
	PutConfigurationSetSendingOptions(name string, sendingEnabled bool) error
	PutConfigurationSetSuppressionOptions(name string, suppressedReasons []string) error
	PutConfigurationSetTrackingOptions(name, customRedirectDomain, httpsPolicy string) error
	PutConfigurationSetVdmOptions(name string, dashboardOptions, guardianOptions map[string]any) error

	// Event destination ops
	CreateConfigurationSetEventDestination(
		configSetName, destName string,
		enabled bool,
		matchingEventTypes []string,
	) (*EventDestination, error)
	GetConfigurationSetEventDestinations(configSetName string) ([]*EventDestination, error)
	DeleteConfigurationSetEventDestination(configSetName, destName string) error
	UpdateConfigurationSetEventDestination(
		configSetName, destName string,
		enabled bool,
		matchingEventTypes []string,
	) error

	// Email sending ops
	SendEmail(from string, to []string, subject, bodyHTML, bodyText string) (string, error)
	SendBulkEmail(
		fromEmailAddress string,
		bulkEmailEntries []map[string]any,
	) ([]map[string]any, error)
	SendCustomVerificationEmail(emailAddress, templateName string) (string, error)
	ListEmails() []Email

	// Contact list ops
	CreateContactList(name, description string) (*ContactList, error)
	GetContactList(name string) (*ContactList, error)
	DeleteContactList(name string) error
	UpdateContactList(name, description string) error
	ListContactLists(nextToken string, pageSize int) page.Page[*ContactList]

	// Contact ops
	CreateContact(
		contactListName, emailAddress string,
		topicPreferences []TopicPreference,
	) (*Contact, error)
	GetContact(contactListName, emailAddress string) (*Contact, error)
	DeleteContact(contactListName, emailAddress string) error
	UpdateContact(contactListName, emailAddress string, topicPreferences []TopicPreference) error
	ListContacts(contactListName, nextToken string, pageSize int) (page.Page[*Contact], error)

	// Custom verification template ops
	CreateCustomVerificationEmailTemplate(
		in *CustomVerificationEmailTemplate,
	) (*CustomVerificationEmailTemplate, error)
	GetCustomVerificationEmailTemplate(name string) (*CustomVerificationEmailTemplate, error)
	DeleteCustomVerificationEmailTemplate(name string) error
	UpdateCustomVerificationEmailTemplate(in *CustomVerificationEmailTemplate) error
	ListCustomVerificationEmailTemplates(
		nextToken string,
		pageSize int,
	) page.Page[*CustomVerificationEmailTemplate]

	// Dedicated IP pool ops
	CreateDedicatedIPPool(poolName, scalingMode string) (*DedicatedIPPool, error)
	GetDedicatedIPPool(poolName string) (*DedicatedIPPool, error)
	DeleteDedicatedIPPool(poolName string) error
	ListDedicatedIPPools(nextToken string, pageSize int) page.Page[string]
	GetDedicatedIP(ip string) (map[string]any, error)
	GetDedicatedIps() []map[string]any
	PutDedicatedIPInPool(ip, poolName string) error
	PutDedicatedIPPoolScalingAttributes(poolName, scalingMode string) error
	PutDedicatedIPWarmupAttributes(ip string, warmupPercentage int) error

	// Deliverability test report ops
	CreateDeliverabilityTestReport(
		reportName, fromEmailAddress string,
	) (*DeliverabilityTestReport, error)
	GetDeliverabilityTestReport(reportID string) (*DeliverabilityTestReport, error)
	ListDeliverabilityTestReports(
		nextToken string,
		pageSize int,
	) page.Page[*DeliverabilityTestReport]

	// Deliverability dashboard ops (stubs)
	GetDeliverabilityDashboardOptions() (map[string]any, error)
	PutDeliverabilityDashboardOption() error
	GetDomainDeliverabilityCampaign(domain, campaignID string) (map[string]any, error)
	GetDomainStatisticsReport(domain, startDate, endDate string) (map[string]any, error)
	ListDomainDeliverabilityCampaigns(
		startDate, endDate, domain, nextToken string,
	) ([]map[string]any, string, error)

	// Email template ops
	CreateEmailTemplate(templateName string, content *EmailTemplateContent) (*EmailTemplate, error)
	GetEmailTemplate(name string) (*EmailTemplate, error)
	DeleteEmailTemplate(name string) error
	UpdateEmailTemplate(name string, content *EmailTemplateContent) error
	ListEmailTemplates(nextToken string, pageSize int) page.Page[*EmailTemplate]
	TestRenderEmailTemplate(name, templateData string) (string, error)

	// Export job ops
	CreateExportJob(dataSource string) (*ExportJob, error)
	GetExportJob(jobID string) (*ExportJob, error)
	ListExportJobs(nextToken string, pageSize int) page.Page[*ExportJob]
	CancelExportJob(jobID string) error

	// Import job ops
	CreateImportJob(dataSource string) (*ImportJob, error)
	GetImportJob(jobID string) (*ImportJob, error)
	ListImportJobs(nextToken string, pageSize int) page.Page[*ImportJob]

	// Suppressed destination ops
	PutSuppressedDestination(email, reason string) error
	GetSuppressedDestination(email string) (*SuppressedDestination, error)
	DeleteSuppressedDestination(email string) error
	ListSuppressedDestinations(nextToken string, pageSize int) page.Page[*SuppressedDestination]

	// Account ops
	GetAccount() (*AccountDetails, error)
	PutAccountDetails(details *AccountDetails) error
	PutAccountSendingAttributes(sendingEnabled bool) error
	PutAccountSuppressionAttributes(suppressedReasons []string) error
	PutAccountVdmAttributes(vdmAttributes map[string]any) error
	PutAccountDedicatedIPWarmupAttributes(autoWarmupEnabled bool) error
	GetBlacklistReports() (map[string][]string, error)

	TagResource(arn string, tags map[string]string) error
	UntagResource(arn string, tagKeys []string) error
	ListTagsForResource(arn string) (map[string]string, error)

	// Insights / analytics (stubs)
	GetEmailAddressInsights(emailAddress string) (map[string]any, error)
	GetMessageInsights(messageID string) (map[string]any, error)
	ListRecommendations(nextToken string, pageSize int) ([]map[string]any, string, error)

	// Multi-region endpoint ops (stubs)
	CreateMultiRegionEndpoint(endpointName string) (string, error)
	GetMultiRegionEndpoint(endpointName string) (map[string]any, error)
	DeleteMultiRegionEndpoint(endpointName string) error
	ListMultiRegionEndpoints(nextToken string, pageSize int) ([]map[string]any, string, error)

	// Tenant ops (stubs)
	CreateTenant(tenantName string) (map[string]any, error)
	GetTenant(tenantName string) (map[string]any, error)
	DeleteTenant(tenantName string) error
	ListTenants(nextToken string, pageSize int) ([]map[string]any, string, error)
	CreateTenantResourceAssociation(tenantName, resourceArn string) error
	DeleteTenantResourceAssociation(tenantName, resourceArn string) error
	ListResourceTenants(resourceArn string, pageSize int) ([]map[string]any, string, error)
	ListTenantResources(tenantName string, pageSize int) ([]map[string]any, string, error)

	// Reputation entity ops (stubs)
	GetReputationEntity(entityID string) (map[string]any, error)
	ListReputationEntities(nextToken string, pageSize int) ([]map[string]any, string, error)
	UpdateReputationEntityCustomerManagedStatus(entityID, status string) error
	UpdateReputationEntityPolicy(entityID, policy string) error

	// Metrics
	BatchGetMetricData(queries []MetricDataQuery) ([]MetricDataResult, error)

	// Infrastructure
	Region() string
	AccountID() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for sesv2 storage operations.

type SuppressedDestination

type SuppressedDestination struct {
	LastUpdateTime time.Time `json:"lastUpdateTime"`
	EmailAddress   string    `json:"emailAddress"`
	Reason         string    `json:"reason"`
}

SuppressedDestination stores a suppressed email address.

type TopicPreference

type TopicPreference struct {
	TopicName          string `json:"topicName"`
	SubscriptionStatus string `json:"subscriptionStatus"`
}

TopicPreference represents a contact topic preference.

type VdmOptions

type VdmOptions struct {
	DashboardOptions map[string]any `json:"dashboardOptions,omitempty"`
	GuardianOptions  map[string]any `json:"guardianOptions,omitempty"`
}

VdmOptions captures the VDM (Virtual Deliverability Manager) configuration of a configuration set.

Jump to

Keyboard shortcuts

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