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..3f8f41f1 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.HashShort(), 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.HashShort(), email, context); err != nil { return err } }