mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 15:53:22 +08:00
user can set note when creating custom alias
This commit is contained in:
parent
d8229102a6
commit
145bed893f
2 changed files with 18 additions and 3 deletions
|
@ -48,8 +48,20 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row col">
|
||||
<button class="btn btn-primary mt-1">Create</button>
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<textarea name="note"
|
||||
class="form-control"
|
||||
rows="3"
|
||||
placeholder="Note, can be anything to help you remember WHY you create this alias. This field is optional."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button class="btn btn-primary mt-1">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -46,6 +46,7 @@ def custom_alias():
|
|||
if request.method == "POST":
|
||||
alias_prefix = request.form.get("prefix")
|
||||
alias_suffix = request.form.get("suffix")
|
||||
alias_note = request.form.get("note")
|
||||
|
||||
if verify_prefix_suffix(
|
||||
current_user, alias_prefix, alias_suffix, user_custom_domains
|
||||
|
@ -61,7 +62,9 @@ def custom_alias():
|
|||
"warning",
|
||||
)
|
||||
else:
|
||||
gen_email = GenEmail.create(user_id=current_user.id, email=full_alias)
|
||||
gen_email = GenEmail.create(
|
||||
user_id=current_user.id, email=full_alias, note=alias_note
|
||||
)
|
||||
|
||||
# get the custom_domain_id if alias is created with a custom domain
|
||||
alias_domain = get_email_domain_part(full_alias)
|
||||
|
|
Loading…
Reference in a new issue