Passed
Push — master ( b0a384...ad04e3 )
by eval
01:25
created

pinpointemail/client_xapi.go   A

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 15
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A pinpointemail.*PinpointEmail.XSendEmailText 0 2 1
A pinpointemail.*PinpointEmail.xSendEmail 0 9 1
A pinpointemail.*PinpointEmail.XSendEmailHTML 0 2 1
1
package pinpointemail
2
3
import (
4
	"context"
5
)
6
7
// XSendEmailText sends text type email.
8
func (svc *PinpointEmail) XSendEmailText(ctx context.Context, subject, body, from string, to ...string) error {
9
	return svc.xSendEmail(ctx, false, subject, body, from, to...)
10
}
11
12
// XSendEmailHTML sends HTML type email.
13
func (svc *PinpointEmail) XSendEmailHTML(ctx context.Context, subject, body, from string, to ...string) error {
14
	return svc.xSendEmail(ctx, true, subject, body, from, to...)
15
}
16
17
func (svc *PinpointEmail) xSendEmail(ctx context.Context, useHTML bool, subject, body, from string, to ...string) error {
18
	_, err := svc.SendEmail(ctx, SendEmailRequest{
19
		Subject: subject,
20
		Body:    body,
21
		From:    from,
22
		To:      to,
23
		UseHTML: useHTML,
24
	})
25
	return err
26
}
27