feat: dodaj prefill email potpisa i body logging
Uvodi signature polje i default predlozak potpisa za nove korisnike, te data migraciju koja popunjava postojece prazne potpise. Email flow sada dosljedno dodaje korisnicki potpis i sprema finalni body poruke u dispatch log radi audita.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
17
backend/modules/fleet/email_utils.py
Normal file
17
backend/modules/fleet/email_utils.py
Normal file
@@ -0,0 +1,17 @@
|
||||
def append_user_signature(body, user):
|
||||
body_text = str(body or '').strip()
|
||||
if user is None:
|
||||
return body_text
|
||||
|
||||
signature = ''
|
||||
get_signature = getattr(user, 'get_email_signature', None)
|
||||
if callable(get_signature):
|
||||
signature = str(get_signature() or '').strip()
|
||||
else:
|
||||
signature = str(getattr(user, 'signature', '') or '').strip()
|
||||
|
||||
if not signature:
|
||||
return body_text
|
||||
if not body_text:
|
||||
return signature
|
||||
return f"{body_text}\n\n{signature}"
|
||||
Reference in New Issue
Block a user