Conditions | 5 |
Total Lines | 28 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package ses |
||
34 | func (r XSendTemplatedEmailRequest) ToRequest() (SendTemplatedEmailRequest, error) { |
||
35 | req := SendTemplatedEmailRequest{ |
||
36 | Destination: r.Destination, |
||
37 | Template: r.Template, |
||
38 | Source: r.From, |
||
39 | ConfigurationSetName: r.ConfigurationSetName, |
||
40 | } |
||
41 | |||
42 | req.TemplateData = "{}" |
||
43 | if len(r.TemplateData) != 0 { |
||
44 | b, err := json.Marshal(r.TemplateData) |
||
45 | if err != nil { |
||
46 | return req, err |
||
47 | } |
||
48 | req.TemplateData = string(b) |
||
49 | } |
||
50 | |||
51 | if len(r.Tags) != 0 { |
||
52 | tags := make([]MessageTag, 0, len(r.Tags)) |
||
53 | for k, v := range r.Tags { |
||
54 | tags = append(tags, MessageTag{ |
||
55 | Name: k, |
||
56 | Value: v, |
||
57 | }) |
||
58 | } |
||
59 | req.Tags = tags |
||
60 | } |
||
61 | return req, nil |
||
62 | } |
||
63 |