func generateFromTemplateData(messageTemplate string, data interface{}) string {
	msg := fmt.Sprintf("%v", data) // when things fail
	tmpl, err := template.New("template").Parse(messageTemplate)
	if err != nil {
		fmt.Println(err)
		return msg
	}

	var buf bytes.Buffer
	err = tmpl.Execute(&buf, data)
	if err != nil {
		fmt.Println(err)
		return msg
	}

	return buf.String()
}
// Generate from generic template data
Generate from generic template data
// Generate from generic template data
func generateFromTemplateData(messageTemplate string, data interface{}) string {
	msg := fmt.Sprintf("%v", data) 
	tmpl, err := template.New("template").Parse(messageTemplate)
	if err != nil {
		fmt.Println(err)
		return msg
	}
	var buf bytes.Buffer
	err = tmpl.Execute(&buf, data)
	if err != nil {
		fmt.Println(err)
		return msg
	}
	return buf.String()
}
func generateFromTemplateData ( messageTemplate string , data interface { } ) string { msg := fmt . Sprintf ( " " , data ) tmpl , err := template . New ( " " ) . Parse ( messageTemplate ) if err != nil { fmt . Println ( err ) return msg } var buf bytes . Buffer err = tmpl . Execute ( & buf , data ) if err != nil { fmt . Println ( err ) return msg } return buf . String ( ) }
Generate from generic template data
Generate from generic template data
// when things fail