play-plugins
play-plugins copied to clipboard
setFrom method unavailable in Scala
I have added the plugin to my conf/play.plugins file, and I have the following in my Build.scala:
"com.typesafe" %% "play-plugins-mailer" % "2.1-RC2"
I'm using Play 2.1 with Scala 2.10
I attempt to call mail.setFrom("...") and the compiler then tells me that setFrom is not a member of com.typesafe.plugin.MailerAPI.
Here are the imports (relevant to this issue) at the top of my file:
import play.api.Play.current import com.typesafe.plugin._
I've also tried this with 2.1.0 version instead of 2.1-RC2 and I encounter the same error.
Code: val mail = use[MailerPlugin].email mail.setSubject("foo") mail.setFrom("foo") // this fails!! mail.sendHtml("foo</html")
p.s. It also says that "setRecipient" is not a member of MailerAPI.
I have the same issue :/
The master branch has a different method name. I think in your case it should be addFrom.
https://github.com/typesafehub/play-plugins/blob/statsd-2.1.1/mailer/src/main/scala/com/typesafe/plugin/MailerPlugin.scala
Yes it's addFrom
.
@acampagna @wingkevin can you tell us if that works for you?