membermail

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package membermail writes the emails ReputeCast sends to team members: invitations, password resets, email changes, two-factor resets and notifications, in the member's app language. internal/systemmail wraps them in the branded layout and sends them through the System stream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminPasswordReset

func AdminPasswordReset(l i18n.Lang, instance, admin, email, link string) mailer.Message

AdminPasswordReset is a reset link an instance admin sent.

func DefaultReason

func DefaultReason(l i18n.Lang, brand string) string

DefaultReason is "This is an automated message from Acme ReputeCast."

func EmailChange

func EmailChange(l i18n.Lang, instance, oldEmail, link string) mailer.Message

EmailChange asks to confirm a new sign-in address.

func EmailChanged

func EmailChanged(l i18n.Lang, instance, oldEmail, newEmail string) mailer.Message

EmailChanged tells the previous address that the sign-in email changed.

func Footer(l i18n.Lang, instance, workspace, host string) string

Footer is "Sent by Acme ReputeCast for Acme Newsletter · reputecast.acme.io".

func Invitation

func Invitation(l i18n.Lang, d InvitationEmail) mailer.Message

Invitation writes an invitation email.

func Notification

func Notification(l i18n.Lang, d NotificationEmail) mailer.Message

Notification writes a notification email: one notification in full, or a digest.

func PasswordReset

func PasswordReset(l i18n.Lang, instance, email, link string) mailer.Message

PasswordReset is the link someone asked for to reset their password.

func Reason

func Reason(l i18n.Lang, kind string) (reason string, ok bool)

Reason says why a message of a member kind was sent, in the reader's language. ok is false for kinds it doesn't know (subscribers' mail).

func ReportSummary

func ReportSummary(l i18n.Lang, d ReportSummaryEmail) mailer.Message

ReportSummary writes the sending summary: an HTML part with tables and a plain-text part with the same numbers.

func SignInReminder

func SignInReminder(l i18n.Lang, instance, email, provider, link string) mailer.Message

SignInReminder tells someone without a password how they sign in.

func TwoFactorReset

func TwoFactorReset(l i18n.Lang, instance, admin, email, reason string, before time.Time) mailer.Message

TwoFactorReset tells a member an instance admin reset their two-factor.

Types

type InvitationEmail

type InvitationEmail struct {
	Inviter, Workspace, Role string
	// Message is the inviter's own words, kept as written.
	Message string
	Link    string
	Expires time.Time
}

InvitationEmail is an invitation to join a workspace, in the invitation's language.

type NotificationEmail

type NotificationEmail struct {
	Workspace string
	Items     []NotificationLine
	// Base is the instance's public URL; Preferences the notification preferences page.
	Base, Preferences string
}

NotificationEmail is one notification, or a digest of several from one workspace.

type NotificationLine

type NotificationLine struct {
	Title, Body string
	// Link is an app path, or empty.
	Link string
}

NotificationLine is one notification in an email.

type ReportSummaryEmail

type ReportSummaryEmail struct {
	Workspace string
	// Frequency is weekly or monthly.
	Frequency string
	// From and To bound the period in the member's time zone: [From, To).
	From, To  time.Time
	Campaigns SummaryCampaigns
	// Top are the most opened campaigns, at most five.
	Top []SummaryCampaign
	// Audience and Health are nil for members whose role doesn't show them.
	Audience *SummaryAudience
	Health   *SummaryHealth
	Links    SummaryLinks
}

ReportSummaryEmail is one member's sending summary of a workspace.

type SummaryAudience

type SummaryAudience struct {
	Joined, Departed int64
	// Subscribers are the lists' subscribed members when the email is written.
	Subscribers int64
}

SummaryAudience is the newsletter's subscribers over the period.

type SummaryCampaign

type SummaryCampaign struct {
	Name                     string
	Sent, HumanOpens, Clicks int64
	// Link opens the campaign's report.
	Link string
}

SummaryCampaign is one of the most opened campaigns.

type SummaryCampaigns

type SummaryCampaigns struct {
	// Started campaigns, of which Collecting are still within the 72
	// hours that opens and clicks keep counting.
	Started, Collecting                                        int
	Sent, Delivered, HumanOpens, Clicks, Unsubscribes, Bounces int64
	// Complaints and their rate of delivered count only the mailbox
	// providers that report complaints; Reported is false when none did.
	Complaints    int64
	ComplaintRate float64
	Reported      bool
}

SummaryCampaigns are the totals of the campaigns started in the period.

type SummaryHealth

type SummaryHealth struct {
	Score int
	// Label is Good, Fair or Poor (the Overview's word).
	Label string
}

SummaryHealth is the workspace's sender health score.

type SummaryLinks struct {
	Campaigns, Deliverability string
	// Preferences is where the member turns the summary off.
	Preferences string
}

SummaryLinks are the screens the email links to.

Jump to

Keyboard shortcuts

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