-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into nested-personalization
- Loading branch information
Showing
19 changed files
with
382 additions
and
179 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @Andrewangeta @fpseverino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: test | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
on: | ||
pull_request: { types: [opened, reopened, synchronize, ready_for_review] } | ||
push: { branches: [ main ] } | ||
|
||
jobs: | ||
unit-tests: | ||
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main | ||
secrets: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: 1 | ||
builder: | ||
configs: | ||
- documentation_targets: [SendGridKit] | ||
swift_version: 6.0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
// swift-tools-version:5.6 | ||
// swift-tools-version:6.0 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "sendgrid-kit", | ||
platforms: [ | ||
.macOS(.v10_15), | ||
.macOS(.v14), | ||
], | ||
products: [ | ||
.library(name: "SendGridKit", targets: ["SendGridKit"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.9.0"), | ||
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.22.0"), | ||
], | ||
targets: [ | ||
.target(name: "SendGridKit", dependencies: [ | ||
.product(name: "AsyncHTTPClient", package: "async-http-client"), | ||
]), | ||
.testTarget(name: "SendGridKitTests", dependencies: [ | ||
.target(name: "SendGridKit"), | ||
]) | ||
.target( | ||
name: "SendGridKit", | ||
dependencies: [ | ||
.product(name: "AsyncHTTPClient", package: "async-http-client"), | ||
], | ||
swiftSettings: swiftSettings | ||
), | ||
.testTarget( | ||
name: "SendGridKitTests", | ||
dependencies: [ | ||
.target(name: "SendGridKit"), | ||
], | ||
swiftSettings: swiftSettings | ||
), | ||
] | ||
) | ||
|
||
var swiftSettings: [SwiftSetting] { [ | ||
.enableUpcomingFeature("ExistentialAny"), | ||
] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 9 additions & 6 deletions
15
Sources/SendGridKit/Models/AdvancedSuppressionManager.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import Foundation | ||
|
||
public struct AdvancedSuppressionManager: Codable { | ||
public struct AdvancedSuppressionManager: Codable, Sendable { | ||
/// The unsubscribe group to associate with this email. | ||
public var groupId: Int | ||
/// | ||
/// See the Suppressions API to manage unsubscribe group IDs. | ||
public var groupID: Int | ||
|
||
/// An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page. | ||
/// | ||
/// This page is displayed in the recipient's browser when they click the unsubscribe link in your message. | ||
public var groupsToDisplay: [String]? | ||
|
||
public init( | ||
groupId: Int, | ||
groupID: Int, | ||
groupsToDisplay: [String]? = nil | ||
) { | ||
self.groupId = groupId | ||
self.groupID = groupID | ||
self.groupsToDisplay = groupsToDisplay | ||
} | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case groupId = "group_id" | ||
case groupID = "group_id" | ||
case groupsToDisplay = "groups_to_display" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,54 @@ | ||
import Foundation | ||
|
||
public struct EmailAttachment: Codable { | ||
|
||
public struct EmailAttachment: Codable, Sendable { | ||
/// The Base64 encoded content of the attachment. | ||
public var content: String | ||
|
||
/// The mime type of the content you are attaching. For example, “text/plain” or “text/html”. | ||
/// The MIME type of the content you are attaching. | ||
/// | ||
/// For example, `image/jpeg`, `text/html` or `application/pdf`. | ||
public var type: String? | ||
|
||
/// The filename of the attachment. | ||
/// The attachment's filename, including the file extension. | ||
public var filename: String | ||
|
||
/// The content-disposition of the attachment specifying how you would like the attachment to be displayed. | ||
public var disposition: String? | ||
/// The attachment's content-disposition specifies how you would like the attachment to be displayed. | ||
/// | ||
/// For example, inline results in the attached file being displayed automatically within the message | ||
/// while attachment results in the attached file requiring some action to be taken before it is displayed | ||
/// such as opening or downloading the file. | ||
public var disposition: Disposition? | ||
|
||
public enum Disposition: String, Codable, Sendable { | ||
case inline | ||
case attachment | ||
} | ||
|
||
/// The content id for the attachment. This is used when the disposition is set to “inline” and the attachment is an image, allowing the file to be displayed within the body of your email. | ||
public var contentId: String? | ||
/// The content ID for the attachment. | ||
/// | ||
/// This is used when the disposition is set to “inline” and the attachment is an image, | ||
/// allowing the file to be displayed within the body of your email. | ||
public var contentID: String? | ||
|
||
public init( | ||
content: String, | ||
type: String? = nil, | ||
filename: String, | ||
disposition: String? = nil, | ||
contentId: String? = nil | ||
disposition: Disposition? = nil, | ||
contentID: String? = nil | ||
) { | ||
self.content = content | ||
self.type = type | ||
self.filename = filename | ||
self.disposition = disposition | ||
self.contentId = contentId | ||
self.contentID = contentID | ||
} | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case content | ||
case type | ||
case filename | ||
case disposition | ||
case contentId = "content_id" | ||
case contentID = "content_id" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.