update email notification subject

This commit is contained in:
Andrew Davidson 2014-04-17 16:52:16 -07:00
parent cf19e1c47d
commit 2a90a2c8a8
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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
}
}