Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hub: make footer of the e-mail notifications #251

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions osh/hub/scan/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def send_task_notification(request, task_id):
]
message = "\n".join(message)

if settings.NOTIFICATION_EMAIL_FOOTER:
message += f"\n{settings.NOTIFICATION_EMAIL_FOOTER}"

subject = "Task [#%s] %s finished, state: %s" % (task_id, package, state)

to = task.args.get("email_to", []) or []
Expand Down Expand Up @@ -196,10 +199,10 @@ def generate_general_text(self, display_states=True):
Fix later -- defect is true positive, but fix is postponed to next release
Not a bug -- issue is false positive, so you are waiving it
"""
message += """
siteshwar marked this conversation as resolved.
Show resolved Hide resolved
You can find documentation of OpenScanHub's workflow at \
https://cov01.lab.eng.brq2.redhat.com/covscan_documentation.html .
"""

if settings.NOTIFICATION_EMAIL_FOOTER:
message += f"\n{settings.NOTIFICATION_EMAIL_FOOTER}"

return message

def generate_rebase_scan_text(self):
Expand Down
2 changes: 2 additions & 0 deletions osh/hub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
# https://github.com/openscanhub/openscanhub/pull/256#pullrequestreview-2001187953
DEFAULT_EMAIL_DOMAIN = "redhat.com"

NOTIFICATION_EMAIL_FOOTER = ""

# override default values with custom ones from local settings
try:
from .settings_local import * # noqa
Expand Down
2 changes: 2 additions & 0 deletions osh/hub/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@
# It is used when `email` field in the user model is not set.
DEFAULT_EMAIL_DOMAIN = "example.org"

NOTIFICATION_EMAIL_FOOTER = "This is a test footer."

ALLOWED_HOSTS = ['*']