Skip to content

Commit

Permalink
Merge pull request #10 from tomwildcat9/master
Browse files Browse the repository at this point in the history
Added required region parameter for MailGun initializer
  • Loading branch information
rafiki270 authored Sep 4, 2019
2 parents 71e08e8 + b745504 commit a779603
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ First create your client configuration:
#### Mailgun

```swift
let config = Mailer.Config.mailgun(key: "{mailgunApi}", domain: "{mailgunDomain}")
let config = Mailer.Config.mailgun(key: "{mailgunApi}", domain: "{mailgunDomain}", region: "{mailgunRegion}")
```

#### SendGrid
Expand Down
6 changes: 3 additions & 3 deletions Sources/MailCore/MailCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Mailer: MailerService {
/// Service configuration
public enum Config {
case none
case mailgun(key: String, domain: String)
case mailgun(key: String, domain: String, region: Mailgun.Region)
case sendGrid(key: String)
case smtp(SMTP)
}
Expand All @@ -69,8 +69,8 @@ public class Mailer: MailerService {
self.config = config

switch config {
case .mailgun(let key, let domain):
services.register(Mailgun(apiKey: key, domain: domain), as: Mailgun.self)
case .mailgun(let key, let domain, let region):
services.register(Mailgun(apiKey: key, domain: domain, region: region), as: Mailgun.self)
case .sendGrid(key: let key):
let config = SendGridConfig(apiKey: key)
services.register(config)
Expand Down

0 comments on commit a779603

Please sign in to comment.