diff --git a/distgit_bugzilla_sync/default-config-files/configuration.toml b/distgit_bugzilla_sync/default-config-files/configuration.toml index 4642edb..4272204 100644 --- a/distgit_bugzilla_sync/default-config-files/configuration.toml +++ b/distgit_bugzilla_sync/default-config-files/configuration.toml @@ -1,11 +1,9 @@ environment = "staging" - -send_email = false -email_from = "accounts@fedoraproject.org" data_cache = "/var/tmp/pagure_sync_bz.json" -notify_emails = [ - "root@localhost.localdomain", -] +bz_maintainer_change_comment = """ +This package has changed maintainer in the Fedora. +Reassigning to the new maintainer of this component. +""" [products] "Fedora" = "Fedora" @@ -29,22 +27,23 @@ notify_emails = [ "modules" = "module" "container" = "container" -bz_maintainer_change_comment = """ -This package has changed maintainer in the Fedora. -Reassigning to the new maintainer of this component. -""" +[email] + send_mails = false + from = "accounts@fedoraproject.org" + notify_admins = [ + "root@localhost.localdomain", + ] -## EMAIL TEMPLATES - -tmpl_admin_email = """ + [email.templates] + admin_notification = """ The following errors were encountered while updating bugzilla with information from the Package Database. Please have the problems taken care of: {errors} """ -# User email for invalid setup -tmpl_user_email = """Greetings. + # User email for invalid setup + user_notification = """Greetings. You are receiving this email because there's a problem with your bugzilla.redhat.com account. diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index 4bf5ecc..10fe942 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -561,11 +561,11 @@ class DistgitBugzillaSync: if notify_user: send_email( - self.env['email_from'], + self.env['email']['from'], [user_email], subject='Please fix your bugzilla.redhat.com account', - message=self.env['tmpl_user_email'], - cc_address=self.env['notify_emails'], + message=self.env['email']['templates']['user_notification'], + cc_address=self.env['email']['notify_admins'], ) new_data[user_email] = { @@ -875,10 +875,12 @@ class DistgitBugzillaSync: else: self.notify_users(errors) send_email( - self.env['email_from'], - self.env['notify_emails'], + self.env['email']['from'], + self.env['email']['notify_admins'], 'Errors while syncing bugzilla with the PackageDB', - self.env['tmpl_admin_email'].format(errors='\n'.join(errors)) + self.env['email']['templates']['admin_notification'].format( + errors='\n'.join(errors) + ) ) else: with open(self.env['data_cache'], 'w') as stream: