We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Im followed the steps, but I have an issue and I'm dont know how to solve.
This is my struct:
// // File.swift // // // Created by Perretta, Marcelo on 10/26/20. //
import Fluent import Vapor import Leaf import SendGridKit
struct AppController { // MARK: Layout func sendContactEmail(req: Request) throws -> EventLoopFuture<Void> { let email = SendGridEmail(from: EmailAddress(email: "[email protected]"), replyTo: EmailAddress(email: "[email protected]"), subject: "Testing Enviroment", content: [["Nombre": "Juan Perez", "Telefono":"34234"]]) req.application.sendgrid.initialize() return try req.application.sendgrid.client.send(emails: [email], on: req.eventLoop) } }
and then in routes:
func routes(_ app: Application) throws { let appController = AppController() app.post("contact", use: appController.sendContactEmail) }
but I got: Type 'Void' cannot conform to 'ResponseEncodable'; only struct/enum/class types can conform to protocols
are there any possibility to return EventLoopFuture<Void> or String from the request method?
<
>
BTW: I'm using:
thanks in advance
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Im followed the steps, but I have an issue and I'm dont know how to solve.
This is my struct:
//
// File.swift
//
//
// Created by Perretta, Marcelo on 10/26/20.
//
import Fluent
import Vapor
import Leaf
import SendGridKit
and then in routes:
but I got: Type 'Void' cannot conform to 'ResponseEncodable'; only struct/enum/class types can conform to protocols
How can I fix this?
are there any possibility to return EventLoopFuture
<
Void>
or String from the request method?BTW:
I'm using:
thanks in advance
The text was updated successfully, but these errors were encountered: