mail/message.go
func (m *Message) AddBody(r render.Renderer, data render.Data) error {
	buf := bytes.NewBuffer([]byte{})
	err := r.Render(buf, m.merge(data))

	if err != nil {
		return err
	}

	m.Bodies = append(m.Bodies, Body{
		Content:     buf.String(),
		ContentType: r.ContentType(),
	})

	return nil
}
func (m *Message) AddBody(r render.Renderer, data render.Data) error {
	buf := bytes.NewBuffer([]byte{})
	err := r.Render(buf, m.merge(data))

	if err != nil {
		return err
	}

	m.Bodies = append(m.Bodies, Body{
		Content:     buf.String(),
		ContentType: r.ContentType(),
	})

	return nil
}
// AddBody the message by receiving a renderer and rendering data, first message will be
// used as the main message Body rest of them will be passed as alternative bodies on the
// email message