Passed
Push — master ( 715886...74726c )
by eval
06:41 queued 04:58
created

ses.*SES.XSendEmailHTML   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 5
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package ses
2
3
import (
4
	"context"
5
)
6
7
// XSendEmailText sends text type email.
8
func (svc *SES) XSendEmailText(ctx context.Context, subject, body, from string, to ...string) error {
9
	return svc.xSendEmail(ctx, subject, "", body, from, to...)
10
}
11
12
// XSendEmailHTML sends HTML type email.
13
func (svc *SES) XSendEmailHTML(ctx context.Context, subject, body, from string, to ...string) error {
14
	return svc.xSendEmail(ctx, subject, body, "", from, to...)
15
}
16
17
func (svc *SES) xSendEmail(ctx context.Context, subject, htmlBody, textBody, from string, to ...string) error {
18
	_, err := svc.SendEmail(ctx, SendEmailRequest{
19
		Destination: Destination{
20
			ToAddresses: to,
21
		},
22
		Source:   from,
23
		Subject:  subject,
24
		HTMLBody: htmlBody,
25
		TextBody: textBody,
26
	})
27
	return err
28
}
29