All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lightningkite.lightningserver.email.ConsoleEmailClient.kt Maven / Gradle / Ivy

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)
        })
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy