-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notification Improvements Stage 1, 70%
- Loading branch information
1 parent
959e2a0
commit 8750f63
Showing
19 changed files
with
518 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
backend/dataall/modules/notifications/services/admin_notifications.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from typing import List | ||
|
||
from dataall.modules.notifications.services.ses_email_notification_service import SESEmailNotificationService | ||
|
||
|
||
class AdminNotificationService: | ||
admin_group = 'DAAdministrators' | ||
|
||
def notify_admins_with_error_log(self, process_error: str, error_logs: List[str], process_name:str = ''): | ||
|
||
subject = f'Data.all alert | Attention Required | Failure in : {process_name}' | ||
email_message = f""" | ||
Following error occurred when , {process_error} <br><br> | ||
""" | ||
for error_log in error_logs: | ||
email_message += error_log + "<br><br>" | ||
|
||
SESEmailNotificationService.create_and_send_email_notifications( | ||
subject=subject, | ||
msg=email_message, | ||
recipient_groups_list=[AdminNotificationService.admin_group] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.