-
Notifications
You must be signed in to change notification settings - Fork 11
/
email_address.go
48 lines (40 loc) · 1.21 KB
/
email_address.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package models
// EmailAddress represents an email address
type EmailAddress string
// String returns the email address as a string
func (e EmailAddress) String() string {
return string(e)
}
// EmailAddressesToStrings converts a slice of EmailAddresses to a slice of string values
func EmailAddressesToStrings(addresses []EmailAddress) []string {
if addresses == nil {
return nil
}
strs := []string{}
for _, address := range addresses {
strs = append(strs, address.String())
}
return strs
}
// EmailAddressesToStringPtrs converts a slice of EmailAddresses to a slice of string pointers
func EmailAddressesToStringPtrs(addresses []EmailAddress) []*string {
if addresses == nil {
return nil
}
strPtrs := []*string{}
for _, address := range addresses {
str := address.String()
strPtrs = append(strPtrs, &str)
}
return strPtrs
}
// NewEmailAddress creates a new email address
func NewEmailAddress(address string) EmailAddress {
return EmailAddress(address)
}
// EmailNotificationRecipients contains info about who to notify when an action is taken on an intake request
type EmailNotificationRecipients struct {
RegularRecipientEmails []EmailAddress
ShouldNotifyITGovernance bool
ShouldNotifyITInvestment bool
}