// NewHTMLMessage creates a new text/html email.
552332
func NewHTMLMessage(from, subject, body string) *Message {
	return NewMessageType(from, subject, body, "text/html")
}
787778
func NewMessage(typ *MessageType) *Message {
	return &Message{
		typ:    typ,
		fields: starlark.StringDict{},
	}
}
291598
func createMessage(message newMessage, sender, reference uint64, text, language string) error {
	message.ClearDefaults()
	message.SetSender(sender)
	message.SetReference(reference)
	message.SetText(html.EscapeString(text))
	return message.SetLanguage(language)
}
654129
func (m *DummyMailbox) NewMessage() Message {
	return &DummyMessage{
		sequenceNumber: 0,
		uid:            0,
		header:         make(textproto.MIMEHeader),
		internalDate:   time.Now(),
		flags:          types.Flags(0),
		mailstore:      m.mailstore,
		mailboxID:      m.ID,
		body:           "",
	}
}
1168053
func (fw *Framework) NewMessage(payload string, agent string, collective string, msgType string, request *Message) (msg *Message, err error) {
	msg, err = NewMessage(payload, agent, collective, msgType, request, fw)

	return
}
566642
func (h *Hermes) GenerateHTML(email Email) (string, error) {
	err := setDefaultHermesValues(h)
	if err != nil {
		return "", err
	}
	return h.generateTemplate(email, h.Theme.HTMLTemplate())
}
836427
func NewMessage(to []string, subject, body string) *Message {
	return NewMessageFrom(to, setting.MailService.From, subject, body)
}
822372
func (l *Logger) NewMessage() *Message {
	msg := newMessage()
	msg.logger = l
	msg.Hostname = l.client.hostname
	return msg
}
1138116
func NewMessageToChannel(username string, text string) MessageConfig {
	return MessageConfig{
		BaseChat: BaseChat{
			ChannelUsername: username,
		},
		Text: text,
	}
}
1145951
func NewMessage(data interface{}) (*Message, error) {
	m := &Message{}
	if err := m.unmarshalInterface(data); err != nil {
		return nil, err
	}
	return m, nil
}
478988
func (a *adapter) newMessage(text string) *hal.Message {
	return &hal.Message{
		ID:   "local-message",
		User: hal.User{ID: "1", Name: "shell"},
		Room: "shell",
		Text: text,
	}
}
212431
func NewMessage(typ Message_MessageType, key []byte, level int) *Message {
	m := &Message{
		Type: typ,
		Key:  key,
	}
	m.SetClusterLevel(level)
	return m
}
243528
func (rtm *RTM) NewOutgoingMessage(text string, channelID string, options ...RTMsgOption) *OutgoingMessage {
	id := rtm.idGen.Next()
	msg := OutgoingMessage{
		ID:      id,
		Type:    "message",
		Channel: channelID,
		Text:    text,
	}
	for _, option := range options {
		option(&msg)
	}
	return &msg
}
345291
func newMessage(r *bufio.Reader, autoParse bool) (*Message, error) {

	msg := Message{
		r:       r,
		tr:      textproto.NewReader(r),
		Headers: make(map[string]string),
	}

	if autoParse {
		if err := msg.Parse(); err != nil {
			return &msg, err
		}
	}

	return &msg, nil
}
1255405
func GetHTMLMessage(msgtype, htmlText string) HTMLMessage {
	return HTMLMessage{
		Body:          html.UnescapeString(htmlRegex.ReplaceAllLiteralString(htmlText, "")),
		MsgType:       msgtype,
		Format:        "org.matrix.custom.html",
		FormattedBody: htmlText,
	}
}
1350628
func (s *MessageTemplateType) SetEmailMessage(v string) *MessageTemplateType {
	s.EmailMessage = &v
	return s
}
508331
func NewPartText(textPlain string) *Message {
	return &Message{
		Header: Header{"Content-Type": []string{"text/plain; charset=\"UTF-8\""}},
		Body:   []byte(textPlain)}
}