package utils
import play.api.mvc._
import play.api._
import play.api.i18n._
import com.typesafe.plugin._
import play.api.Play.current

case class SendMail(notifyTypeForMessage: Long, fromAddress: String, partId: Long, notifyTypeForLink: Long, state: Long) {
  def sendMail(toAddress:String) = {
    var mail = use[com.typesafe.plugin.MailerPlugin].email
    mail.addFrom(this.fromAddress)
    mail.setSubject(Messages("mail.message1" + notifyTypeForMessage))
    mail.addRecipient(toAddress)
    mail.sendHtml("<html>" + Messages("mail.message1" + notifyTypeForMessage) +
    		"<br /><a href=\"http://" + Messages("mailserver.name") + ":9000/notifylist?page=0&partId=" + this.partId + "&notifyType=" + notifyTypeForLink + "&state=" + this.state + "\" " + ">" + Messages("mail.message2") + "</a></html>")
  }
}