code: func (m *mailer) resolveEmailAddresses() (emailToRecipientMap, error) {
  	result := make(emailToRecipientMap, len(m.destinations))
  
  	for _, r := range m.destinations {
  		// Get the email address for the reg ID
  		emails, err := emailsForReg(r.id, m.dbMap)
  		if err != nil {
  			return nil, err
  		}
  
  		for _, email := range emails {
  			parsedEmail, err := mail.ParseAddress(email)
  			if err != nil {
  				m.log.Errf("unparseable email for reg ID %d : %q", r.id, email)
  				continue
  			}
  			addr := parsedEmail.Address
  			result[addr] = append(result[addr], r)
  		}
  	}
  	return result, nil
  }
docs: // resolveEmailAddresses looks up the id of each recipient to find that
  // account's email addresses, then adds that recipient to a map from address to
  // recipient struct.