Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
petrpavlik authored Nov 6, 2024
1 parent 58d548f commit b732449
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,20 @@ extension Application {
This will give you easy access to the SDK methods using `application` and `request`.
```swift
app.get { req async in
try await req.indiePitcher.listContacts()

let emailBody = """
This is a sample body that supports **markdown**. Plain html is also supported.
"""

try await indiePitcher.sendEmail(
data: .init(
to: "[email protected]", subject: "Hello from AWS Lambda!", body: emailBody,
bodyFormat: .markdown))

return "ok"
}
```
See the [full example repository](https://github.com/IndiePitcher/VaporExample).

<br/>

Expand Down Expand Up @@ -126,7 +137,7 @@ struct MyLambda: SimpleLambdaHandler {

try await indiePitcher.sendEmail(
data: .init(
to: "[email protected]", subject: "Hello from ASS Lambda!", body: emailBody,
to: "[email protected]", subject: "Hello from AWS Lambda!", body: emailBody,
bodyFormat: .markdown))

return "Email sent!"
Expand Down

0 comments on commit b732449

Please sign in to comment.