We can now send an email with an reset code.
Fixes: #10095
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
dist_templates_messages_users_DATA = \
src/templates/messages/users/account-activation.markdown \
- src/templates/messages/users/email-activation.markdown
+ src/templates/messages/users/email-activation.markdown \
+ src/templates/messages/users/password-reset.markdown
templates_messages_usersdir = $(templates_messagesdir)/users
# Add a recovery code to the database and a timestamp when this code expires
self.password_recovery_code = generate_random_string(64)
- # XXX
- # We should send an email with the activation code
-
+ # Send an email with the activation code
+ self.send_template("messages/users/password-reset", user=self)
@property
def activated(self):
--- /dev/null
+Subject: {{ _("Password Reset") }}
+
+{{ _("You, or somebody else has requested a password reset for the Pakfire Build Service.") }}
+
+{{ _("To reset your password, please click on the link below:") }}
+
+ {{ baseurl }}/password-reset?code={{ user.password_recovery_code }}
+
+Sincerely,
+-The Pakfire Build Service