From 2a90a2c8a8d59fcb4461525abc38f2c397f412d5 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Thu, 17 Apr 2014 16:52:16 -0700 Subject: [PATCH] update email notification subject --- pkg/mail/mail.go | 8 ++++---- pkg/plugin/notify/email.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/mail/mail.go b/pkg/mail/mail.go index 2bc83938..33b3cf82 100644 --- a/pkg/mail/mail.go +++ b/pkg/mail/mail.go @@ -74,9 +74,9 @@ func SendPassword(to string, data interface{}) error { } // Sends a build success email to the user. -func SendSuccess(repo, to string, data interface{}) error { +func SendSuccess(repo, sha, to string, data interface{}) error { msg := Message{} - msg.Subject = "[SUCCESS] " + repo + msg.Subject = fmt.Sprintf("[%s] SUCCESS building %s", repo, sha) msg.To = to var buf bytes.Buffer @@ -91,9 +91,9 @@ func SendSuccess(repo, to string, data interface{}) error { } // Sends a build failure email to the user. -func SendFailure(repo, to string, data interface{}) error { +func SendFailure(repo, sha, to string, data interface{}) error { msg := Message{} - msg.Subject = "[FAILURE] " + repo + msg.Subject = fmt.Sprintf("[%s] FAILURE building %s", repo, sha) msg.To = to var buf bytes.Buffer diff --git a/pkg/plugin/notify/email.go b/pkg/plugin/notify/email.go index 3699a7c2..5f80d746 100644 --- a/pkg/plugin/notify/email.go +++ b/pkg/plugin/notify/email.go @@ -26,7 +26,7 @@ func (e *Email) Send(context *Context) error { func (e *Email) sendFailure(context *Context) error { // loop through and email recipients for _, email := range e.Recipients { - if err := mail.SendFailure(context.Repo.Name, email, context); err != nil { + if err := mail.SendFailure(context.Repo.Name, context.Commit.Hash, email, context); err != nil { return err } } @@ -38,7 +38,7 @@ func (e *Email) sendFailure(context *Context) error { func (e *Email) sendSuccess(context *Context) error { // loop through and email recipients for _, email := range e.Recipients { - if err := mail.SendSuccess(context.Repo.Name, email, context); err != nil { + if err := mail.SendSuccess(context.Repo.Name, context.Commit.Hash, email, context); err != nil { return err } }