mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-05 01:39:33 +00:00
Added an mechanism to reset passwords via mail.
This commit is contained in:
parent
0716b8ff93
commit
6a0d027675
20 changed files with 2373 additions and 64 deletions
30
templates/mail/base.html.twig
Normal file
30
templates/mail/base.html.twig
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{% apply inky_to_html|inline_css(source('@css/foundation-emails.css'), source('@css/email.css')) %}
|
||||
|
||||
<container>
|
||||
<spacer size="16"></spacer>
|
||||
<row class="header">
|
||||
<columns>
|
||||
<spacer size="16"></spacer>
|
||||
<h4 class="text-center"><a href="{{ url('homepage') }}">{{ partdb_title }}</a></h4>
|
||||
</columns>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<columns>
|
||||
|
||||
<spacer size="32"></spacer>
|
||||
{% block content %}
|
||||
|
||||
{% endblock %}
|
||||
</columns>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<columns>
|
||||
<p><small>This email was send automatically by <a href="{{ url('homepage') }}">Part-DB</a>. Dont answer to this email.</small></p>
|
||||
</columns>
|
||||
</row>
|
||||
|
||||
<spacer size="16"></spacer>
|
||||
</container>
|
||||
{% endapply %}
|
||||
30
templates/mail/pw_reset.html.twig
Normal file
30
templates/mail/pw_reset.html.twig
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{% extends "mail/base.html.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<row>
|
||||
<columns>
|
||||
<h4>Hi {{ user.fullName }},</h4>
|
||||
somebody (hopefully you) requested an reset of your password.
|
||||
If this request was not made by you, ignore this email.
|
||||
<br>
|
||||
<button class="large expand" href="{{ url('pw_reset_new_pw', {user: user.name, token: token}) }}">Click here to reset password</button>
|
||||
<br>
|
||||
If this dont work for you. Go to <a href="{{ url('pw_reset_new_pw') }}">{{ url('pw_reset_new_pw') }}</a>
|
||||
and enter the following info:
|
||||
<callout class="secondary">
|
||||
<row>
|
||||
<columns>
|
||||
<p>
|
||||
<b>Username: </b> {{ user.name }}
|
||||
</p>
|
||||
<p>
|
||||
<b>Token:</b> {{ token }}
|
||||
</p>
|
||||
</columns>
|
||||
</row>
|
||||
</callout>
|
||||
The reset token will be valid until <i>{{ expiration_date|format_datetime }}</i>.
|
||||
</columns>
|
||||
</row>
|
||||
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue