// GetEmail returns the Email field if it's non-nil, zero value otherwise.
351978
func (u *User) GetEmail() string {
	if u == nil || u.Email == nil {
		return ""
	}
	return *u.Email
}
342531
func IsEmail(field, email string) []ValidationMsg {
	if emailRegex.MatchString(email) {
		return []ValidationMsg{}
	}

	return []ValidationMsg{ValidationMsg{Field: field, Msg: NotEmailMsg}}
}
323809
func (s *RegisterToWorkMailInput) SetEmail(v string) *RegisterToWorkMailInput {
	s.Email = &v
	return s
}
880698
func (s *User) SetEmail(v string) *User {
	s.Email = &v
	return s
}
279375
func Email() string {
	var email string

	email = getRandValue([]string{"person", "first"}) + getRandValue([]string{"person", "last"})
	email += "@"
	email += getRandValue([]string{"person", "last"}) + "." + getRandValue([]string{"internet", "domain_suffix"})

	return strings.ToLower(email)
}
1011455
func SendEmail(config cfg.Config, subject, body string, tos []string) error {
	email := Compose(subject, body)
	email.From = config.GetString("smtp_user")
	email.ContentType = "text/html; charset=utf-8"
	email.AddRecipients(tos...)
	err := email.Send(config)
	return err
}
42688
func (s *RegisterUserInput) SetEmail(v string) *RegisterUserInput {
	s.Email = &v
	return s
}
509229
func (s *service) Retrieve(email string) (resDTO rest.ResponseDTO, error *servicehelper.Error) {
	entity, err := s.repo.FindByEmail(email)
	if err != nil {
		return rest.ResponseDTO{}, &servicehelper.Error{
			Detail:  errors.New("user could not be found"),
			Message: "We could not find any user with the provided email address",
			Param:   "email",
			Code:    servicehelper.NotFound,
		}
	}
	return createDTOFromEntity(entity), error
}
1344528
func (s *DomainsService) GetEmailForward(accountID string, domainIdentifier string, forwardID int64) (*emailForwardResponse, error) {
	path := versioned(emailForwardPath(accountID, domainIdentifier, forwardID))
	forwardResponse := &emailForwardResponse{}

	resp, err := s.client.get(path, forwardResponse)
	if err != nil {
		return nil, err
	}

	forwardResponse.HttpResponse = resp
	return forwardResponse, nil
}
522713
func (s *CreateGovCloudAccountInput) SetEmail(v string) *CreateGovCloudAccountInput {
	s.Email = &v
	return s
}
339083
func (b *bundle) GenerateEmail(templateName string, input *EmailTemplateInput) (subject, body string) {
	var err error
	if subject, body, err = b.executeUserTemplate(templateName, input); err != nil {
		// Execution of the user-defined template failed.
		// Fallback to the error template.
		subject, body = b.executeErrorTemplate(templateName, input, err)
	}
	return
}
819083
func (g *GPGEmail) GetEmail() string {
	if g == nil || g.Email == nil {
		return ""
	}
	return *g.Email
}
63483
func (s *Group) SetEmail(v string) *Group {
	s.Email = &v
	return s
}
1285484
func (mg *MailgunImpl) GetTemplate(ctx context.Context, name string) (Template, error) {
	r := newHTTPRequest(generateApiUrl(mg, templatesEndpoint) + "/" + name)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	r.addParameter("active", "yes")

	var resp templateResp
	err := getResponseFromJSON(ctx, r, &resp)
	if err != nil {
		return Template{}, err
	}
	return resp.Item, nil
}
1290232
func SendEmail(toPersons []string, subject string, mailTemplate string, data map[string]interface{}) error {
	log.Info("will send mail...")

	m := gomail.NewMessage()
	m.SetHeader("From", "notice@uke.email")
	m.SetHeader("To", toPersons...)
	m.SetHeader("Subject", subject)

	d := gomail.NewDialer(SMTP, Port, Sender, Password)
	tmpl, err := tmpl.Parse(mailTemplate)
	if err != nil {
		return err
	}

	var contents bytes.Buffer
	if err = tmpl.Execute(&contents, data); err != nil {
		return err
	}

	m.SetBody("text/html", contents.String())

	return d.DialAndSend(m)
}
854443
func (s Session) AddEmail(email string) Session {
	return s.appendString(TypeEmail, email)
}
1194200
func (m *MarketplacePlanAccount) GetEmail() string {
	if m == nil || m.Email == nil {
		return ""
	}
	return *m.Email
}