com.lightningkite.lightningserver.email.ConsoleEmailClient.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of server-core Show documentation
Show all versions of server-core Show documentation
A set of tools to fill in/replace what Ktor is lacking in.
The newest version!
package com.lightningkite.lightningserver.email
import com.lightningkite.lightningserver.http.HttpContent
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.toList
/**
* A concrete implementation of EmailClient that will simply print out everything to the console
* This is useful for local development
*/
object ConsoleEmailClient : EmailClient {
override suspend fun send(email: Email) {
println(buildString {
appendLine("-----EMAIL-----")
appendLine(email.subject)
appendLine()
appendLine(email.to.joinToString())
appendLine()
appendLine(email.plainText)
})
}
}