// GetEmail returns the Email field if it's non-nil, zero value otherwise.
331355
func (i *Invitation) GetEmail() string {
	if i == nil || i.Email == nil {
		return ""
	}
	return *i.Email
}
1194200
func (m *MarketplacePlanAccount) GetEmail() string {
	if m == nil || m.Email == nil {
		return ""
	}
	return *m.Email
}
965841
func (s *CreateUserInput) SetEmail(v string) *CreateUserInput {
	s.Email = &v
	return s
}
602715
func (s *UserInfo) SetEmail(v string) *UserInfo {
	s.Email = &v
	return s
}
845534
func (c *CreateOrgInvitationOptions) GetEmail() string {
	if c == nil || c.Email == nil {
		return ""
	}
	return *c.Email
}
1239121
func (u *usersService) GetUserByEmail(email string) (schema.User, error) {
	return u.db.GetByEmail(email)
}
984964
func Email() string {
	return strings.ToLower(FirstName(RandomGender)+LastName()) + StringNumberExt(1, "", 3) + "@" + randomFrom(jsonData.Domains)
}
743201
func (m *EmailValidatorImpl) ValidateEmail(ctx context.Context, email string, mailBoxVerify bool) (EmailVerification, error) {
	r := newHTTPRequest(m.getAddressURL("validate"))
	r.setClient(m.Client())
	r.addParameter("address", email)
	if mailBoxVerify {
		r.addParameter("mailbox_verification", "true")
	}
	r.setBasicAuth(basicAuthUser, m.APIKey())

	var response EmailVerification
	err := getResponseFromJSON(ctx, r, &response)
	if err != nil {
		return EmailVerification{}, err
	}

	return response, nil
}
323809
func (s *RegisterToWorkMailInput) SetEmail(v string) *RegisterToWorkMailInput {
	s.Email = &v
	return s
}
1209245
func (emailServer *EmailServer) SendEmail(data *SMTPData) error {
	var doc bytes.Buffer
	t := template.New("emailTemplate")
	t, err := t.Parse(SMTPTemplate)
	if err != nil {
		log.Fatal("error trying to parse mail template", err)
		return err
	}
	err = t.Execute(&doc, data)
	if err != nil {
		log.Fatal("error tring to map data to the smtp email template", err)
		return err
	}
	err = emailServer.sendMailFunc(emailServer.host+":"+strconv.Itoa(emailServer.port),
		emailServer.auth,
		data.From,
		[]string{data.To},
		doc.Bytes())
	return err
}
214073
func IsEmail(s string) bool {
	if !strings.Contains(s, "@") || string(s[0]) == "@" || string(s[len(s)-1]) == "@" {
		return false
	}
	return true
}
1263528
func (a *Auth) GetLogin() (string, error) {
	if !a.parsed {
		a.parse()
	}

	return a.login, a.err
}
733946
func (g *Generic) getPrimaryEmail(client *http.Client) (string, error) {
	emailsEndpoint := g.APIURL + "/emails"
	r, err := client.Get(emailsEndpoint)
	if err != nil {
		return "", err
	}
	defer r.Body.Close()

	emails := []*UserEmail{}
	if err = json.NewDecoder(r.Body).Decode(&emails); err != nil {
		return "", err
	}

	email, err := g.primaryEmail(emails)
	if err != nil {
		g.Logger.Error("Unable to retrieve primary email ", err.Error())
		return "", err
	}
	return email, nil
}
243785
func (o *Organization) GetBillingEmail() string {
	if o == nil || o.BillingEmail == nil {
		return ""
	}
	return *o.BillingEmail
}
598134
func (c *CommitAuthor) GetEmail() string {
	if c == nil || c.Email == nil {
		return ""
	}
	return *c.Email
}
597135
func getPrimaryEmail(client *github.Client, log chronograf.Logger) (string, error) {
	emails, resp, err := client.Users.ListEmails(context.TODO(), nil)
	if err != nil {
		logResponseError(log, resp, err)
		return "", err
	}

	email, err := primaryEmail(emails)
	if err != nil {
		log.Error("Unable to retrieve primary Github email ", err.Error())
		return "", err
	}
	return email, nil
}
618655
func (p *provider) getUserEmail(token string) (string, error) {
	var email string
	err := p.page(p.githubUserEmailURL, token,
		func() interface{} {
			return &[]githubUserEmail{}
		},
		func(obj interface{}) error {
			for _, userEmail := range *(obj.(*[]githubUserEmail)) {
				// store the email regardless of if it the primary in case we somehow never get a primary one
				email = userEmail.Email
				if userEmail.Primary {
					return errStopEmail
				}
			}
			return nil
		},
	)
	// this error just stops iteration early on the first primary email (there should only ever be one primary)
	if err == errStopEmail {
		return email, nil
	}
	return email, err
}