diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-06-18 18:49:23 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-06-18 18:49:23 +0300 |
commit | 3c13f8387e1327259540dff05edc4ec4532bd994 (patch) | |
tree | 2fb44932e723086e0d44081420f2c6244c916359 | |
parent | 77c2d6ef20c825cd4fad4c5a92c51aa0e1658234 (diff) | |
download | ick2-3c13f8387e1327259540dff05edc4ec4532bd994.tar.gz |
Add: controller URL to notification mails
-rw-r--r-- | ick2/sendmail.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ick2/sendmail.py b/ick2/sendmail.py index 423b9f6..2c2b4d4 100644 --- a/ick2/sendmail.py +++ b/ick2/sendmail.py @@ -19,14 +19,15 @@ import smtplib body_tmpl = """\ -This is a notification from ick, the CI system. +This is a build notification from ick. -Project: {project} -Build ID: {build_id} -Log ID: {log} -Worker: {worker} -Status: {status} -Exit code: {exit_code} +Controller: {controller_url} +Project: {project} +Build ID: {build_id} +Log ID: {log} +Worker: {worker} +Status: {status} +Exit code: {exit_code} Build log is attached. @@ -37,6 +38,7 @@ class Sendmail: config_fields = [ 'from_addr', + 'controller_url', 'smtp_server', 'smtp_port', 'smtp_user', @@ -79,7 +81,8 @@ class Sendmail: def get_body(self, build): msg = email.message.Message() - msg.set_payload(body_tmpl.format(**build)) + msg.set_payload(body_tmpl.format( + controller_url=self._config['controller_url'], **build)) msg.add_header('Content-Type', 'text/plain') return msg |