Skip to content

Commit

Permalink
Merge pull request #12 from dylanshine/master
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
Andrewangeta authored Aug 7, 2022
2 parents 4fa5c75 + 84836ad commit 408e259
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.6
import PackageDescription

let package = Package(
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SendGridKit

![Swift](http://img.shields.io/badge/swift-5.2-brightgreen.svg)
![Swift](http://img.shields.io/badge/swift-5.6-brightgreen.svg)

SendGridKit is a Swift package used to communicate with the SendGrid API for Server Side Swift Apps.

Expand All @@ -10,7 +10,7 @@ Add the dependency to Package.swift:
~~~~swift
dependencies: [
...
.package(url: "https://github.com/vapor-community/sendgrid-kit.git", from: "1.0.0")
.package(url: "https://github.com/vapor-community/sendgrid-kit.git", from: "2.0.0")
],
targets: [
.target(name: "App", dependencies: [
Expand All @@ -22,7 +22,7 @@ Register the config and the provider.

~~~~swift
let httpClient = HTTPClient(...)
let sendgridClient = SendGridClient(httpClient: httpClient, apiKey: "YOUR_API_KEY")
let sendGridClient = SendGridClient(httpClient: httpClient, apiKey: "YOUR_API_KEY")
~~~~

## Using the API
Expand All @@ -34,7 +34,7 @@ Usage in a route closure would be as followed:
import SendGrid

let email = SendGridEmail(...)
try sendGridClient.send(email, on: eventLoop)
try await sendGridClient.send(email)
~~~~

## Error handling
Expand All @@ -43,7 +43,7 @@ Simply ensure you catch errors thrown like any other throwing function

~~~~swift
do {
try sendGridClient.send(...)
try await sendGridClient.send(...)
}
catch let error as SendGridError {
print(error)
Expand Down

0 comments on commit 408e259

Please sign in to comment.