com.mchange.feedletter.default.email.statusChange-html-untemplate.scala Maven / Gradle / Ivy
// DO NOT HAND EDIT -- Autogenerated from 'statusChange.html.untemplate' at 2024-01-22T21:31:23.510785Z
package com.mchange.feedletter.default.email
import java.io.{Writer,StringWriter}
import scala.collection.{immutable,mutable}
import com.mchange.feedletter.*
import com.mchange.feedletter.style.*
val Untemplate_statusChange_html = new untemplate.Untemplate[StatusChangeInfo,Nothing]:
val UntemplateFunction : untemplate.Untemplate[StatusChangeInfo,Nothing] = this
val UntemplateName : String = "statusChange_html"
val UntemplatePackage : String = "com.mchange.feedletter.default.email"
val UntemplateInputName : String = "sci"
val UntemplateInputTypeDeclared : String = "StatusChangeInfo"
val UntemplateInputTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[StatusChangeInfo] )
val UntemplateInputDefaultArgument : Option[StatusChangeInfo] = (None : Option[StatusChangeInfo])
val UntemplateOutputMetadataTypeDeclared : String = "Nothing"
val UntemplateOutputMetadataTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[Nothing] )
val UntemplateHeaderNote : String = ""
val UntemplateAttributes : immutable.Map[String,Any] = immutable.Map.empty
def apply(sci : StatusChangeInfo) : untemplate.Result[Nothing] =
val writer : StringWriter = new StringWriter(18710)
val attrs : immutable.Map[String,Any] = UntemplateAttributes
var mbMetadata : Option[Nothing] = None
var outputTransformer : Function1[untemplate.Result[Nothing],untemplate.Result[Nothing]] = identity
val d = scala.xml.Utility.escape( sci.destination.fullDesc )
val block0 = new Function0[String]:
def apply() : String =
"\n\n \n \n \n \n [" + ( sci.subscribableName ) +
"] Subscription " + ( sci.change ) +
" \n \n \n \n"
writer.write(block0())
sci.change match {
case SubscriptionStatusChange.Created => {
val block1 = new Function0[String]:
def apply() : String =
" Subscription created!
\n\n
\n\n " + ( d ) +
" has been subscribed to " + ( sci.subscribableName ) +
".
\n"
writer.write(block1())
if sci.requiresConfirmation then {
val block2 = new Function0[String]:
def apply() : String =
" The subscription still needs to be confirmed.
\n\n If this subscription was made error, please don't confirm it.
\n\n Or you can explicitly unsubscribe.
\n"
writer.write(block2())
}
else {
val block3 = new Function0[String]:
def apply() : String =
" If this subscription was made error, please unsubscribe.
\n"
writer.write(block3())
}
}
case SubscriptionStatusChange.Confirmed => {
val block4 = new Function0[String]:
def apply() : String =
" Subscription confirmed!
\n\n
\n\n The subscription of " + ( d ) +
" to " + ( sci.subscribableName ) +
" has been confirmed.
\n\n If you confirmed this subscription in error, you can unsubscribe.
\n"
writer.write(block4())
}
case SubscriptionStatusChange.Removed => {
val block5 = new Function0[String]:
def apply() : String =
" Subscription removed!
\n\n
\n\n " + ( d ) +
" has been unsubscribed from " + ( sci.subscribableName ) +
".
\n\n If you unsubscribed in error, you can resubscribe by clicking here.
\n"
writer.write(block5())
}
}
val block6 = new Function0[String]:
def apply() : String =
" \n \n\n\n\n"
writer.write(block6())
outputTransformer( untemplate.Result( mbMetadata, writer.toString ) )
end apply
end Untemplate_statusChange_html
def statusChange_html(sci : StatusChangeInfo) : untemplate.Result[Nothing] = Untemplate_statusChange_html( sci )
© 2015 - 2025 Weber Informatics LLC | Privacy Policy