optout

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

type MessageRef

type MessageRef struct {
	MessageID  uuid.UUID
	ContactID  uuid.UUID
	CampaignID *uuid.UUID
}

MessageRef names the email the unsubscribe came from: the message (Nil when unknown) and the contact. CampaignID is used when the message isn't known (the message's own campaign wins).

Jump to

Keyboard shortcuts

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