Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
SendinBlueMailer allows you to integrate SendinBlue email services into your project.
Add the following dependency to your
.package(url:"https://github.com/lucianobohrer/SendinBlueMailer.git", from: "1.0.0"),
1 - Import
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:
2 - Initialize
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:
3 Configure the email
Beside the initialization you need to map your data into the
let sender = Individual(name: "Jhon doe", email: "email@example.com") let receiver = Individual(name: "Jane Doe", email: "firstname.lastname@example.org") 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.