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>
18 lines
511 B
Python
18 lines
511 B
Python
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}"
|