Contents

hsharghi/vapor-resend

**VaporResend** is a wrapper for the [SwiftResend](https://github.com/hsharghi/swift-resend.git) package,

Setup

Add Dependency

Add the dependency to your Package.swift:

dependencies: [
	...
	.package(url: "https://github.com/hsharghi/vapor-resend.git", from: "1.0.0")
],
targets: [
    .target(name: "App", dependencies: [
        .product(name: "VaporResend", package: "vapor-resend"),
    ]),

Configure Environment Variable

Provide the RESEND_API_KEY environment variable for authentication.

Usage

Sending Emails

Import VaporResend modules and configure your routes:

import Vapor
import VaporResend

func routes(_ app: Application) throws {
    app.get("send") { req async throws -> String in
        let id = try await req.resend.emails.send(email: .init(from: .init(email: "hadi@domain.com", name: "Hadi"),
                                            to: ["john@apple.com"],
                                            subject: "Sending email from Vapor",
                                           text: "Email sent using ResendVapor"))
        
        return id
    }
}

For full SDK documentation check out SwiftResend Package.

License

This package is released under the MIT license. See LICENSE for details.

Package Metadata

Repository: hsharghi/vapor-resend

Default branch: main

README: README.md