Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed May 22, 2020
1 parent b48111e commit 25dd722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -155,6 +155,8 @@ import Vapor
import HTTP
import SES

let client = SES(region: .uswest1)

final class MyController {
struct EmailData: Content {
let address: String
Expand All @@ -164,8 +166,6 @@ final class MyController {
func sendUserEmailFromJSON(_ req: Request) throws -> EventLoopFuture<HTTPStatus> {
return try req.content.decode(EmailData.self)
.flatMap { (emailData)->EventLoopFuture<SES.SendEmailResponse> in
let client = SES(region: .uswest1)

let destination = SES.Destination(toAddresses: [emailData.address])
let message = SES.Message(body:SES.Body(text:SES.Content(data:emailData.message)), subject:SES.Content(data:emailData.subject))
let sendEmailRequest = SES.SendEmailRequest(destination: destination, message: message, source:"awssdkswift@me.com")
Expand Down

0 comments on commit 25dd722

Please sign in to comment.