Documentation
¶
Overview ¶
Package mailer sends the transactional emails of the auth flows (verify your email, reset your password). The service package declares the one-method interface it needs; this package holds implementations.
Console writes the message to the application log, which is all you need to develop and demo the flows: copy the link from the log. In production, implement the same method on top of an email API or SMTP (SES, Postmark, Resend, ...), ideally behind a queue, so a slow provider does not slow down requests and failures can be retried.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Console ¶
Console logs every message instead of sending it. THIS DELIBERATELY LOGS THE LINK, WHICH CONTAINS A LIVE TOKEN: it is a development tool. Never use it where logs are shared or retained.
type Memory ¶
type Memory struct {
// Err, when set, is returned by Send (and nothing is recorded), to test mail failures.
Err error
// contains filtered or unexported fields
}
Memory records messages instead of sending them. It is the test double: a test performs an action ("forgot password"), then reads the token out of the captured email, exactly like a user would click the link. Safe for concurrent use.