1
0
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:
Haris Chaniotakis 2021-02-17 19:22:03 +02:00
parent 2653f998c5
commit d192dd1c1f

View File

@ -49,12 +49,12 @@ 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{
input := &ses.SendEmailInput{
Source: a.senderAddress,
Destination: &types.Destination{
ToAddresses: a.receiverAddresses,
}
input.Message = &types.Message{
},
Message: &types.Message{
Body: &types.Body{
Html: &types.Content{
Data: aws.String(message),
@ -66,6 +66,7 @@ func (a AmazonSES) Send(subject, message string) error {
Subject: &types.Content{
Data: aws.String(subject),
},
},
}
_, err := a.client.SendEmail(context.Background(), input)