04/27 Updated customer invitation allow customer to create username & password

This commit is contained in:
2026-04-27 14:44:02 -04:00
parent b18b23a796
commit bd05384a59
3 changed files with 134 additions and 44 deletions
+38 -12
View File
@@ -14,9 +14,8 @@
<div class="card-body">
<p class="text-muted mb-4" style="font-size:.9rem;">
Enter the customer's name and email address. An invitation email will be
sent automatically with a secure link to set their password.
The account will be activated once they complete that step.
Enter the customer's details and set their login credentials.
The account will be active immediately.
</p>
<form method="POST">
@@ -31,22 +30,50 @@
{% endfor %}
</div>
<div class="mb-4">
<div class="mb-3">
{{ form.email.label(class="form-label fw-semibold") }}
{{ form.email(class="form-control" + (" is-invalid" if form.email.errors else ""),
placeholder="jane@example.com") }}
{% for error in form.email.errors %}
<div class="invalid-feedback">{{ error }}</div>
{% endfor %}
</div>
<div class="mb-3">
{{ form.username.label(class="form-label fw-semibold") }}
{{ form.username(class="form-control" + (" is-invalid" if form.username.errors else ""),
placeholder="e.g. jsmith") }}
{% for error in form.username.errors %}
<div class="invalid-feedback">{{ error }}</div>
{% endfor %}
<div class="form-text">
<i class="bi bi-envelope me-1"></i>
An invitation email with a password setup link will be sent to this address.
<i class="bi bi-person me-1"></i>
Used to log in. Lowercase letters, numbers, dots, hyphens, and underscores only.
</div>
</div>
<div class="mb-3">
{{ form.password.label(class="form-label fw-semibold") }}
{{ form.password(class="form-control" + (" is-invalid" if form.password.errors else ""),
autocomplete="new-password") }}
{% for error in form.password.errors %}
<div class="invalid-feedback">{{ error }}</div>
{% endfor %}
<div class="form-text">Minimum 8 characters.</div>
</div>
<div class="mb-4">
{{ form.confirm_password.label(class="form-label fw-semibold") }}
{{ form.confirm_password(class="form-control" + (" is-invalid" if form.confirm_password.errors else ""),
autocomplete="new-password") }}
{% for error in form.confirm_password.errors %}
<div class="invalid-feedback">{{ error }}</div>
{% endfor %}
</div>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary">
<i class="bi bi-send me-1"></i>Create &amp; Send Invitation
<i class="bi bi-person-check me-1"></i>Create Account
</button>
<a href="{{ url_for('customers.index') }}" class="btn btn-outline-secondary">
<i class="bi bi-x-circle me-1"></i>Cancel
@@ -63,14 +90,13 @@
<strong>What happens next:</strong>
</p>
<ol class="mb-0 ps-3" style="font-size:.8rem; color:#555;">
<li>A username is automatically generated from the email address.</li>
<li>An invitation email is sent to the customer with a secure 72-hour link.</li>
<li>The customer clicks the link and sets their own password.</li>
<li>The account becomes fully active and they can log in immediately.</li>
<li>The account is created immediately and the customer can log in right away.</li>
<li>A welcome email is sent to the customer with a link to the login page.</li>
<li>Assign the customer to Contracts or Facilities from their profile page.</li>
</ol>
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}