Skip to content

Instantly share code, notes, and snippets.

@dph01
Created June 13, 2012 09:02
Show Gist options
  • Select an option

  • Save dph01/2922933 to your computer and use it in GitHub Desktop.

Select an option

Save dph01/2922933 to your computer and use it in GitHub Desktop.

Revisions

  1. dph01 revised this gist Jun 13, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    val template = Templates.findRawTemplate(templatePath, S.locale)

    template.map(t => {
    val out = "#dear" #> user.shortName &
    val out = ("#dear" #> user.shortName &
    "#validationLink [href]" #> validationLink)(t)
    out.head.asInstanceOf[Elem]
    }).openOr {
  2. dph01 revised this gist Jun 13, 2012. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,7 @@
    val template = Templates.findRawTemplate(templatePath, S.locale)

    template.map(t => {
    // note - needed to put 'dear' in here rather than in the template file as
    // the test was failing, the space after the 'dear' was getting lost somehow
    val out = ("#dear" #> ("Dear " + user.shortName) &
    val out = "#dear" #> user.shortName &
    "#validationLink [href]" #> validationLink)(t)
    out.head.asInstanceOf[Elem]
    }).openOr {
  3. dph01 created this gist Jun 13, 2012.
    16 changes: 16 additions & 0 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    def signupMailBody(user: User, validationLink: String): Elem = {
    val templatePath = List("user", "signupmailbody")
    val template = Templates.findRawTemplate(templatePath, S.locale)

    template.map(t => {
    // note - needed to put 'dear' in here rather than in the template file as
    // the test was failing, the space after the 'dear' was getting lost somehow
    val out = ("#dear" #> ("Dear " + user.shortName) &
    "#validationLink [href]" #> validationLink)(t)
    out.head.asInstanceOf[Elem]
    }).openOr {
    val msg = "template: " + templatePath + " not found"
    error(msg)
    throw new Exception(msg)
    }
    }