sendingaccessnotice

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sendingaccessnotice emails an account owner the operator's decision on an external sending access request.

The local operator commands (-approve-external-sending with -external-sending-request-id, and -decline-external-sending-request) decide the request in their own committed transaction, then call NotifyDecision. The notice is platform mail about the account, so it leaves through the same authorized seam as every other notification: a customer_notification operation prepared from the durable request row, Reserve, ConsumeAttempt, and one ProviderSubmitter call per charged attempt. The envelope is the gate's (the account owner's current address), never a caller's.

Content is operator-authored only. The customer's free-text request fields are never echoed back: the notice states the decision and where to go next.

Index

Constants

View Source
const (
	DecisionApproved = "approved"
	DecisionDeclined = "declined"
)

Decision states the notice reports, mirroring the request row.

View Source
const SendingAccessPath = "/sending-access"

SendingAccessPath is the dashboard page a declined notice links to.

Variables

This section is empty.

Functions

func Render

func Render(decision, requestID, publicURL string, replyable bool) (subject, text, htmlBody string)

Render returns the subject, plain-text and HTML bodies of a decision notice. Everything in it is operator-authored copy plus the request id and the deployment's dashboard URL; no customer-supplied text is included.

Types

type Notifier

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

Notifier composes and sends decision notices.

func New

func New(pool TxBeginner, gate sendingpolicy.Gate, s Submitter, fromDomain, fromAddress, replyTo, publicURL string) *Notifier

New returns a Notifier. fromDomain is outbound_smtp.from_domain; fromAddress and replyTo are the optional notifications.from_address and notifications.reply_to values (the deployment's notification identity); publicURL builds the dashboard links (empty degrades to generic copy).

func (*Notifier) NotifyDecision

func (n *Notifier) NotifyDecision(ctx context.Context, requestID string) error

NotifyDecision emails the owner of the request's account the decision the request row records. It returns an error when the notice was not sent; the caller (an operator command whose decision has already committed) reports it as a warning and does not fail.

func (*Notifier) WithDKIM

func (n *Notifier) WithDKIM(lookup outbound.DKIMKeyLookup) *Notifier

WithDKIM wires per-domain DKIM signing for the From domain (fail-open, as for the other notices).

type Submitter

type Submitter interface {
	SubmitOnce(ctx context.Context, auth sendingpolicy.ProviderAuthorization, env outbound.Envelope) (outbound.ProviderResult, error)
}

Submitter is the one provider seam (*outbound.ProviderSubmitter).

type TxBeginner

type TxBeginner interface {
	Begin(ctx context.Context) (pgx.Tx, error)
}

TxBeginner is the transaction surface the notice needs (*pgxpool.Pool).

Jump to

Keyboard shortcuts

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