Skip to content

Commit 4270d8e

Browse files
authored
Merge pull request #29 from AAAstorga/master
Add inline support
2 parents 2f4ae2f + 55d7a13 commit 4270d8e

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let package = Package(
1212
targets: ["Mailgun"]),
1313
],
1414
dependencies: [
15-
.package(url: "https://github.com/vapor/vapor.git"),
15+
.package(url: "https://github.com/vapor/vapor.git", from: "3.3.0")
1616
],
1717
targets: [
1818
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

Sources/Mailgun/Models/Message.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ extension Mailgun {
1515
public let text: String
1616
public let html: String?
1717
public let attachment: [File]?
18+
public let inline: [File]?
1819

1920
private enum CodingKeys : String, CodingKey {
20-
case from, to, replyTo = "h:Reply-To", cc, bcc, subject, text, html, attachment
21+
case from, to, replyTo = "h:Reply-To", cc, bcc, subject, text, html, attachment, inline
2122
}
2223

23-
public init(from: String, to: String, replyTo: String? = nil, cc: String? = nil, bcc: String? = nil, subject: String, text: String, html: String? = nil, attachments: [File]? = nil) {
24+
public init(from: String, to: String, replyTo: String? = nil, cc: String? = nil, bcc: String? = nil, subject: String, text: String, html: String? = nil, attachments: [File]? = nil, inline: [File]? = nil) {
2425
self.from = from
2526
self.to = to
2627
self.replyTo = replyTo
@@ -30,9 +31,10 @@ extension Mailgun {
3031
self.text = text
3132
self.html = html
3233
self.attachment = attachments
34+
self.inline = inline
3335
}
3436

35-
public init(from: String, to: [String], replyTo: String? = nil, cc: [String]? = nil, bcc: [String]? = nil, subject: String, text: String, html: String? = nil, attachments: [File]? = nil) {
37+
public init(from: String, to: [String], replyTo: String? = nil, cc: [String]? = nil, bcc: [String]? = nil, subject: String, text: String, html: String? = nil, attachments: [File]? = nil, inline: [File]? = nil) {
3638
self.from = from
3739
self.to = to.joined(separator: ",")
3840
self.replyTo = replyTo
@@ -42,9 +44,10 @@ extension Mailgun {
4244
self.text = text
4345
self.html = html
4446
self.attachment = attachments
47+
self.inline = inline
4548
}
4649

47-
public init(from: String, to: [FullEmail], replyTo: String? = nil, cc: [FullEmail]? = nil, bcc: [FullEmail]? = nil, subject: String, text: String, html: String? = nil, attachments: [File]? = nil) {
50+
public init(from: String, to: [FullEmail], replyTo: String? = nil, cc: [FullEmail]? = nil, bcc: [FullEmail]? = nil, subject: String, text: String, html: String? = nil, attachments: [File]? = nil, inline: [File]? = nil) {
4851
self.from = from
4952
self.to = to.stringArray.joined(separator: ",")
5053
self.replyTo = replyTo
@@ -54,6 +57,7 @@ extension Mailgun {
5457
self.text = text
5558
self.html = html
5659
self.attachment = attachments
60+
self.inline = inline
5761
}
5862
}
5963
}

0 commit comments

Comments
 (0)