Support choose email when creating a commit via web UI (#33432)
Initial PR for #24469
This commit is contained in:
parent
ac2d97cb61
commit
256b94e9e9
19 changed files with 356 additions and 182 deletions
|
@ -542,3 +542,13 @@ func IsEmailDomainAllowed(email string) bool {
|
|||
|
||||
return validation.IsEmailDomainListed(setting.Service.EmailDomainAllowList, email)
|
||||
}
|
||||
|
||||
func GetActivatedEmailAddresses(ctx context.Context, uid int64) ([]string, error) {
|
||||
emails := make([]string, 0, 2)
|
||||
if err := db.GetEngine(ctx).Table("email_address").Select("email").
|
||||
Where("uid=? AND is_activated=?", uid, true).Asc("id").
|
||||
Find(&emails); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return emails, nil
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ func (u *User) GetPlaceholderEmail() string {
|
|||
return fmt.Sprintf("%s@%s", u.LowerName, setting.Service.NoReplyAddress)
|
||||
}
|
||||
|
||||
// GetEmail returns an noreply email, if the user has set to keep his
|
||||
// GetEmail returns a noreply email, if the user has set to keep his
|
||||
// email address private, otherwise the primary email address.
|
||||
func (u *User) GetEmail() string {
|
||||
if u.KeepEmailPrivate {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue