change email attachmentname to peerName if not empty
parent
fedf7db8a4
commit
6ec8d2f201
|
|
@ -1511,7 +1511,8 @@ def API_Email_Send():
|
|||
subject = Template(data.get('Subject', '')).render(peer=p.toJson(), configurationFile=download)
|
||||
if data.get('IncludeAttachment', False):
|
||||
u = str(uuid4())
|
||||
attachmentName = f'{u}.conf'
|
||||
peerName = p.toJson().get('name', '').strip()
|
||||
attachmentName = f'{peerName if peerName else u}.conf'
|
||||
with open(os.path.join('./attachments', attachmentName,), 'w+') as f:
|
||||
f.write(download['file'])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue