// ArrList - convert to comma-seperated list of email Addresses

convert to comma-seperated list of email Addresses
// ArrList - convert to comma - seperated list of email Addresses
func (ea EmailAddresses) ArrList(includeName bool) string {
	if includeName == false {
		arr := ea.Addresses()
		if len(arr) == 1 {
			return arr[0]
		}
		return strings.Join(arr, ",")
	}
	arr := []string{}
	for _, emailAddress := range ea {
		addr := mail.Address{Name: emailAddress.Name, Address: emailAddress.Address}
		arr = append(arr, addr.String())
	}
	if len(arr) == 1 {
		return arr[0]
	}
	return strings.Join(arr, ",")
}
func ( ea EmailAddresses ) ArrList ( includeName bool ) string { if includeName == false { arr := ea . Addresses ( ) if len ( arr ) == 1 { return arr [ 0 ] } return strings . Join ( arr , " " ) } arr := [ ] string { } for _ , emailAddress := range ea { addr := mail . Address { Name : emailAddress . Name , Address : emailAddress . Address } arr = append ( arr , addr . String ( ) ) } if len ( arr ) == 1 { return arr [ 0 ] } return strings . Join ( arr , " " ) }
convert to comma-seperated list of email Addresses
convert to comma - seperated list of email Addresses