commonMain.raven.ConsoleEmailConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of raven-email-console Show documentation
Show all versions of raven-email-console Show documentation
An abstraction form sending emails
package raven
fun AgentConfiguration.toConsoleEmailAgent(): Sender {
return ConsoleEmailAgent(toConsoleEmailAgentOptions())
}
fun AgentConfiguration.toConsoleEmailAgentOptions(): ConsoleEmailAgentOptions {
val formatter = PrettyConsoleEmailFormatter(
PrettyConsoleEmailFormatterOptions(
separator = params["separator"] ?: "=",
width = params["width"]?.toIntOrNull() ?: 95,
margin = params["margin"]?.toIntOrNull() ?: 25,
border = params["border"] ?: "|",
padding = params["padding"]?.toIntOrNull() ?: 1
)
)
return ConsoleEmailAgentOptions(outbox = outbox, formatter = formatter)
}