Skip to content

Commit

Permalink
added SendMailHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Crosby committed Dec 31, 2012
1 parent a6b7cb4 commit 3dd82b4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion amzses.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2011 Numrotron Inc.
// Copyright 2011-2013 Numrotron Inc.
// Use of this source code is governed by an MIT-style license
// that can be found in the LICENSE file.
//
Expand Down Expand Up @@ -46,6 +46,19 @@ func SendMail(from, to, subject, body string) (string, error) {
return sesGet(data)
}

func SendMailHTML(from, to, subject, bodyText, bodyHTML string) (string, error) {
data := make(url.Values)
data.Add("Action", "SendEmail")
data.Add("Source", from)
data.Add("Destination.ToAddresses.member.1", to)
data.Add("Message.Subject.Data", subject)
data.Add("Message.Body.Text.Data", bodyText)
data.Add("Message.Body.Html.Data", bodyHTML)
data.Add("AWSAccessKeyId", accessKey)

return sesGet(data)
}

func authorizationHeader(date string) []string {
h := hmac.New(sha256.New, []uint8(secretKey))
h.Write([]uint8(date))
Expand Down

0 comments on commit 3dd82b4

Please sign in to comment.