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 ¶
- func AdminPasswordReset(l i18n.Lang, instance, admin, email, link string) mailer.Message
- func DefaultReason(l i18n.Lang, brand string) string
- func EmailChange(l i18n.Lang, instance, oldEmail, link string) mailer.Message
- func EmailChanged(l i18n.Lang, instance, oldEmail, newEmail string) mailer.Message
- func Footer(l i18n.Lang, instance, workspace, host string) string
- func Invitation(l i18n.Lang, d InvitationEmail) mailer.Message
- func Notification(l i18n.Lang, d NotificationEmail) mailer.Message
- func PasswordReset(l i18n.Lang, instance, email, link string) mailer.Message
- func Reason(l i18n.Lang, kind string) (reason string, ok bool)
- func ReportSummary(l i18n.Lang, d ReportSummaryEmail) mailer.Message
- func SignInReminder(l i18n.Lang, instance, email, provider, link string) mailer.Message
- func TwoFactorReset(l i18n.Lang, instance, admin, email, reason string, before time.Time) mailer.Message
- type InvitationEmail
- type NotificationEmail
- type NotificationLine
- type ReportSummaryEmail
- type SummaryAudience
- type SummaryCampaign
- type SummaryCampaigns
- type SummaryHealth
- type SummaryLinks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminPasswordReset ¶
AdminPasswordReset is a reset link an instance admin sent.
func DefaultReason ¶
DefaultReason is "This is an automated message from Acme ReputeCast."
func EmailChange ¶
EmailChange asks to confirm a new sign-in address.
func EmailChanged ¶
EmailChanged tells the previous address that the sign-in email changed.
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 ¶
PasswordReset is the link someone asked for to reset their password.
func Reason ¶
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 ¶
SignInReminder tells someone without a password how they sign in.
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 ¶
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 ¶
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.