mirror of
https://github.com/nikoksr/notify.git
synced 2025-03-31 21:55:29 +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
|
// Send takes a message subject and a message body and sends them to all previously set chats. Message body supports
|
||||||
// html as markup language.
|
// html as markup language.
|
||||||
func (a AmazonSES) Send(subject, message string) error {
|
func (a AmazonSES) Send(subject, message string) error {
|
||||||
input := &ses.SendEmailInput{}
|
input := &ses.SendEmailInput{
|
||||||
input.Source = a.senderAddress
|
Source: a.senderAddress,
|
||||||
input.Destination = &types.Destination{
|
Destination: &types.Destination{
|
||||||
ToAddresses: a.receiverAddresses,
|
ToAddresses: a.receiverAddresses,
|
||||||
}
|
|
||||||
input.Message = &types.Message{
|
|
||||||
Body: &types.Body{
|
|
||||||
Html: &types.Content{
|
|
||||||
Data: aws.String(message),
|
|
||||||
},
|
|
||||||
// Text: &types.Content{
|
|
||||||
// Data: aws.String(message),
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
Subject: &types.Content{
|
Message: &types.Message{
|
||||||
Data: aws.String(subject),
|
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