mirror of
https://github.com/nikoksr/notify.git
synced 2025-03-29 21:46:58 +02:00
refactor(service): construct email input on a single initialization
This commit is contained in:
parent
2653f998c5
commit
d192dd1c1f
@ -49,22 +49,23 @@ func (a *AmazonSES) AddReceivers(addresses ...string) {
|
||||
// Send takes a message subject and a message body and sends them to all previously set chats. Message body supports
|
||||
// html as markup language.
|
||||
func (a AmazonSES) Send(subject, message string) error {
|
||||
input := &ses.SendEmailInput{}
|
||||
input.Source = a.senderAddress
|
||||
input.Destination = &types.Destination{
|
||||
ToAddresses: a.receiverAddresses,
|
||||
}
|
||||
input.Message = &types.Message{
|
||||
Body: &types.Body{
|
||||
Html: &types.Content{
|
||||
Data: aws.String(message),
|
||||
},
|
||||
// Text: &types.Content{
|
||||
// Data: aws.String(message),
|
||||
// },
|
||||
input := &ses.SendEmailInput{
|
||||
Source: a.senderAddress,
|
||||
Destination: &types.Destination{
|
||||
ToAddresses: a.receiverAddresses,
|
||||
},
|
||||
Subject: &types.Content{
|
||||
Data: aws.String(subject),
|
||||
Message: &types.Message{
|
||||
Body: &types.Body{
|
||||
Html: &types.Content{
|
||||
Data: aws.String(message),
|
||||
},
|
||||
// Text: &types.Content{
|
||||
// Data: aws.String(message),
|
||||
// },
|
||||
},
|
||||
Subject: &types.Content{
|
||||
Data: aws.String(subject),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user