Skip to content

Commit

Permalink
REmove HTML message
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmxs committed Mar 21, 2018
1 parent 193fdf7 commit 3cd941c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions action/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ type instancesMessage struct {
op *types.OpType
}

func (m *instancesMessage) HTMLMessage() string {
func (m *instancesMessage) Message() string {
var buffer bytes.Buffer
buffer.WriteString(fmt.Sprintf("<b>Operation: %s</b><ul>", m.op.String()))
buffer.WriteString("/code\n")
buffer.WriteString(fmt.Sprintf("Operation: %s\n", m.op.String()))
for _, inst := range m.Instances {
owner := inst.Owner
if len(owner) == 0 {
owner = "???"
}
buffer.WriteString(fmt.Sprintf("<li>[%s] instance name: <b>%s</b> created: %s owner: <b>%s</b></li>", inst.CloudType, inst.Name, inst.Created, owner))
buffer.WriteString(fmt.Sprintf("[%s] instance name: %s created: %s owner: %s\n", inst.CloudType, inst.Name, inst.Created, owner))
}
buffer.WriteString("</ul>")
return buffer.String()
}
4 changes: 2 additions & 2 deletions hipchat/hipchat.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func (h *Hipchat) Send(message types.Message) error {
log.Infof("[HIPCHAT] %s", string(out))
} else {
_, err := client.Room.Notification(room, &hipchat.NotificationRequest{
Message: message.HTMLMessage(),
Message: message.Message(),
Color: "green",
MessageFormat: "html",
MessageFormat: "text",
})
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion types/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Action interface {
}

type Message interface {
HTMLMessage() string
Message() string
}

type Dispatcher interface {
Expand Down

0 comments on commit 3cd941c

Please sign in to comment.