Skip to content

Commit

Permalink
chg: [mail exporter] add object url only if email is ail user
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 29, 2025
1 parent 9802b04 commit d53328b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/exporter/MailExporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# Import Project packages
##################################
from lib import ail_logger
from lib import ail_users
from exporter.abstract_exporter import AbstractExporter
from lib.ConfigLoader import ConfigLoader
# from lib.objects.abstract_object import AbstractObject
Expand Down Expand Up @@ -133,18 +134,17 @@ def export(self, tracker, obj, matches=[]):

subject = f'AIL Framework Tracker: {description}'
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:
body += '\n'
nb = 1
for match in matches:
body += f'\nMatch {nb}: {match[0]}\nExtract:\n{match[1]}\n\n'
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():
if ail_users.exists_user(mail):
body = ail_link + body
self._export(mail, subject, body)

0 comments on commit d53328b

Please sign in to comment.