mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-01-31 06:26:14 +00:00
chg: [mail exporter] add object url only if email is ail user
This commit is contained in:
parent
9802b04fa6
commit
d53328b55b
1 changed files with 5 additions and 5 deletions
|
@ -26,6 +26,7 @@ sys.path.append(os.environ['AIL_BIN'])
|
||||||
# Import Project packages
|
# Import Project packages
|
||||||
##################################
|
##################################
|
||||||
from lib import ail_logger
|
from lib import ail_logger
|
||||||
|
from lib import ail_users
|
||||||
from exporter.abstract_exporter import AbstractExporter
|
from exporter.abstract_exporter import AbstractExporter
|
||||||
from lib.ConfigLoader import ConfigLoader
|
from lib.ConfigLoader import ConfigLoader
|
||||||
# from lib.objects.abstract_object import AbstractObject
|
# from lib.objects.abstract_object import AbstractObject
|
||||||
|
@ -133,7 +134,7 @@ class MailExporterTracker(MailExporter):
|
||||||
|
|
||||||
subject = f'AIL Framework Tracker: {description}'
|
subject = f'AIL Framework Tracker: {description}'
|
||||||
body = f"AIL Framework, New occurrence for {tracker_type} tracker: {tracker_name}\n"
|
body = f"AIL Framework, New occurrence for {tracker_type} tracker: {tracker_name}\n"
|
||||||
body += f'Item: {obj.id}\nurl:{obj.get_link()}'
|
body += f'Object {obj.type}: {obj.id}\n'
|
||||||
|
|
||||||
if matches:
|
if matches:
|
||||||
body += '\n'
|
body += '\n'
|
||||||
|
@ -141,10 +142,9 @@ class MailExporterTracker(MailExporter):
|
||||||
for match in matches:
|
for match in matches:
|
||||||
body += f'\nMatch {nb}: {match[0]}\nExtract:\n{match[1]}\n\n'
|
body += f'\nMatch {nb}: {match[0]}\nExtract:\n{match[1]}\n\n'
|
||||||
nb += 1
|
nb += 1
|
||||||
else:
|
|
||||||
body = f"AIL Framework, New occurrence for {tracker_type} tracker: {tracker_name}\n"
|
|
||||||
body += f'Item: {obj.id}\nurl:{obj.get_link()}'
|
|
||||||
|
|
||||||
# print(body)
|
ail_link = f'AIL url:{obj.get_link()}/n/n'
|
||||||
for mail in tracker.get_mails():
|
for mail in tracker.get_mails():
|
||||||
|
if ail_users.exists_user(mail):
|
||||||
|
body = ail_link + body
|
||||||
self._export(mail, subject, body)
|
self._export(mail, subject, body)
|
||||||
|
|
Loading…
Add table
Reference in a new issue