Documentation
¶
Overview ¶
Package optout applies an unsubscribe that came from an email ReputeCast sent: a one-click POST, the unsubscribe page, or an email to the mailto: address of List-Unsubscribe (M58). The contact leaves every list and marketing to the address stops; the message's campaign counts the unsubscribe, the contact's timeline shows it, and its automation step counts it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(ctx context.Context, tx pgx.Tx, d Deps, ws *store.Workspace, ref MessageRef, ev audience.PublicEvidence, reason, comment string) (audience.UnsubscribeResult, error)
Apply unsubscribes the contact inside tx and records what the email it came from needs. reason and comment, when given, are the feedback the unsubscribe page asked for.
Types ¶
type Deps ¶
type Deps struct {
Audience *audience.Service
// MessageUnsubscribed, optional, is told when the unsubscribe came from
// a message (an automation email counts it on its step).
MessageUnsubscribed func(ctx context.Context, q *store.Queries, messageID uuid.UUID, at time.Time) error
}
Deps are what an unsubscribe changes beyond the contact.