Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 0 |
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 |