func (d *Dispatcher) getFormattedTitle(n *model.Notification) string {
	trimmedTitle := strings.TrimSpace(n.Title)
	title := html.EscapeString(trimmedTitle)
	if d.formatting.ColoredTitle {
		title = d.coloredText(d.priorityToColor(n.Priority), title)
	}
	return "<b>" + title + "</b><br /><br />"
}
HTML-formats the title
package dispatcher
import (
	"fmt"
	"html"
	"log"
	"strings"
	"github.com/gomarkdown/markdown"
	"github.com/matrix-org/gomatrix"
	"github.com/pushbits/server/internal/model"
	"github.com/pushbits/server/internal/pberrors"
)
type MessageFormat string
type MsgType string
const (
	MessageFormatHTML = MessageFormat("org.matrix.custom.html")
	MsgTypeText       = MsgType("m.text")
)
type MessageEvent struct {
	Body          string        `json:"body"`
	FormattedBody string        `json:"formatted_body"`
	MsgType       MsgType       `json:"msgtype"`
	RelatesTo     RelatesTo     `json:"m.relates_to,omitempty"`
	Format        MessageFormat `json:"format"`
	NewContent    NewContent    `json:"m.new_content,omitempty"`
}
type RelatesTo struct {
	InReplyTo map[string]string `json:"m.in_reply_to,omitempty"`
	RelType   string            `json:"rel_type,omitempty"`
	EventID   string            `json:"event_id,omitempty"`
}
type NewContent struct {
	Body          string        `json:"body"`
	FormattedBody string        `json:"formatted_body"`
	MsgType       MsgType       `json:"msgtype"`
	Format        MessageFormat `json:"format"`
}
func (d *Dispatcher) SendNotification(a *model.Application, n *model.Notification) (id string, err error) {
	log.Printf("Sending notification to room %s.", a.MatrixID)
	plainMessage := strings.TrimSpace(n.Message)
	plainTitle := strings.TrimSpace(n.Title)
	message := d.getFormattedMessage(n)
	title := d.getFormattedTitle(n)
	text := fmt.Sprintf("%s\n\n%s", plainTitle, plainMessage)
	formattedText := fmt.Sprintf("%s %s", title, message)
	respSendEvent, err := d.client.SendFormattedText(a.MatrixID, text, formattedText)
	return respSendEvent.EventID, err
}
func (d *Dispatcher) DeleteNotification(a *model.Application, n *model.DeleteNotification) error {
	log.Printf("Sending delete notification to room %s", a.MatrixID)
	var oldFormattedBody string
	var oldBody string
	deleteMessage, err := d.getMessage(a, n.ID)
	if err != nil {
		log.Println(err)
		return pberrors.ErrorMessageNotFound
	}
	oldBody, oldFormattedBody, err = bodiesFromMessage(deleteMessage)
	if err != nil {
		return err
	}
	newBody := fmt.Sprintf("<del>%s</del>\n- deleted", oldBody)
	newFormattedBody := fmt.Sprintf("<del>%s</del><br>- deleted", oldFormattedBody)
	_, err = d.replaceMessage(a, newBody, newFormattedBody, deleteMessage.ID, oldBody, oldFormattedBody)
	if err != nil {
		return err
	}
	_, err = d.respondToMessage(a, "This message got deleted", "<i>This message got deleted.</i>", deleteMessage)
	return err
}