tenseleyflow/shithub / b255df5

Browse files

email: add state-change notice bodies (password, logout-everywhere, username, primary email, account deletion)

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
b255df519a052687fa71a83ee465f07925e4391c
Parents
bf19c81
Tree
6953f06

1 changed file

StatusFile+-
M internal/auth/email/messages.go 67 0
internal/auth/email/messages.gomodified
@@ -121,6 +121,73 @@ then contact support.`,
121121
 <p>Sign in and re-enable 2FA as soon as you can.</p>
122122
 <p>If you did NOT request this, sign in immediately and reset your password, then contact support.</p>`,
123123
 	},
124
+	"password_changed": {
125
+		Subject: "Your {{.SiteName}} password was changed",
126
+		Text: `Hi {{.Username}},
127
+
128
+Your {{.SiteName}} password was just changed from the account settings.
129
+All other sessions have been signed out as a precaution.
130
+
131
+If this wasn't you, reset your password immediately at /password/reset
132
+and review the security log under /settings.`,
133
+		HTML: `<p>Hi <strong>{{.Username}}</strong>,</p>
134
+<p>Your {{.SiteName}} password was just changed from the account settings. All other sessions have been signed out as a precaution.</p>
135
+<p>If this wasn't you, reset your password immediately and review your security log.</p>`,
136
+	},
137
+	"log_out_everywhere": {
138
+		Subject: "All other sessions signed out — {{.SiteName}}",
139
+		Text: `Hi {{.Username}},
140
+
141
+You signed out of every other session on your {{.SiteName}} account.
142
+Your current browser stays signed in.
143
+
144
+If this wasn't you, change your password immediately and review your
145
+security settings.`,
146
+		HTML: `<p>Hi <strong>{{.Username}}</strong>,</p>
147
+<p>You signed out of every other session on your {{.SiteName}} account. Your current browser stays signed in.</p>
148
+<p>If this wasn't you, change your password immediately and review your security settings.</p>`,
149
+	},
150
+	"username_changed": {
151
+		Subject: "Your {{.SiteName}} username was changed",
152
+		Text: `Hi {{.Username}},
153
+
154
+Your {{.SiteName}} username was just changed. The old name now redirects
155
+to the new one for 30 days, then is released.
156
+
157
+If this wasn't you, sign in and review your account immediately.`,
158
+		HTML: `<p>Hi <strong>{{.Username}}</strong>,</p>
159
+<p>Your {{.SiteName}} username was just changed. The old name now redirects to the new one for 30 days, then is released.</p>
160
+<p>If this wasn't you, sign in and review your account immediately.</p>`,
161
+	},
162
+	"primary_email_changed": {
163
+		Subject: "Primary email changed on your {{.SiteName}} account",
164
+		Text: `Hi {{.Username}},
165
+
166
+The primary email on your {{.SiteName}} account was just changed.
167
+This is the address account-related notifications go to from now on.
168
+
169
+If this wasn't you, sign in and review your security settings.`,
170
+		HTML: `<p>Hi <strong>{{.Username}}</strong>,</p>
171
+<p>The primary email on your {{.SiteName}} account was just changed. This is the address account-related notifications go to from now on.</p>
172
+<p>If this wasn't you, sign in and review your security settings.</p>`,
173
+	},
174
+	"account_deletion_initiated": {
175
+		Subject: "Your {{.SiteName}} account was scheduled for deletion",
176
+		Text: `Hi {{.Username}},
177
+
178
+Your {{.SiteName}} account has been deleted. You have 14 days to undo this
179
+by signing in again with your existing username and password — that
180
+restores the account in place.
181
+
182
+After 14 days the account stays permanently deleted.
183
+
184
+If this wasn't you, sign in immediately to restore the account and then
185
+change your password.`,
186
+		HTML: `<p>Hi <strong>{{.Username}}</strong>,</p>
187
+<p>Your {{.SiteName}} account has been deleted. You have <strong>14 days</strong> to undo this by signing in again with your existing username and password — that restores the account in place.</p>
188
+<p>After 14 days the account stays permanently deleted.</p>
189
+<p>If this wasn't you, sign in immediately to restore the account and then change your password.</p>`,
190
+	},
124191
 }
125192
 
126193
 // TokenCreatedMessage notifies the user that a new PAT was minted on