SendinBlueMailer allows you to integrate SendinBlue email services into your project.
Add the following dependency to your Package.swift
file:
.package(url:"https://github.com/lucianobohrer/SendinBlueMailer.git", from: "1.0.0"),
It's really easy to get started with the SendinBlueMailer library! First you need to import the library, by adding this to the top of your Swift file:
import SendinBlueMailer
To initialize your SendinBlueMailer client, just copy the following code:
let mailClient = SendInBlueClient(httpClient: /* httpClient*/,
apiKey: apiKey)
In case of you're using vapor4 you can use this line as httpClient:
req.application.http.client.shared
Beside the initialization you need to map your data into the SIBEmail
class
let sender = Individual(name: "Jhon doe", email: "[email protected]")
let receiver = Individual(name: "Jane Doe", email: "[email protected]")
let email = SIBEmail(sender: sender,
to: receiver],
subject: "Subject here",
htmlContent: """
<html>
<body>
<p>Your content here.</p>
</body>
</html>
""")
Feel welcome to contribute to this project! :)
This project was released under the MIT license.