I’m trying to use the Mailer plugin with my Play project and I’ve ran into a little trouble. The project compiles well and I can access the website on my localhost, yet eclipse shows errors:
def sendEmail = Action {
import play.api.Play.current
import com.typesafe.plugin._
val mail = use[MailerPlugin].email
mail.setSubject("mailer")
mail.addRecipient("Peter Hausel Junior <noreply@email.com>","example@foo.com")
mail.addFrom("Peter Hausel <noreply@email.com>")
//sends html
mail.sendHtml("<html>html</html>" )
//sends text/text
mail.send( "text" )
//sends both text and html
mail.send( "text", "<html>html</html>")
Ok(views.html.indexLoggedout())
}
The error refers to line 2: plugin is not a member of com.typesafe
Here is Build.scala
val appDependencies = Seq(
"com.typesafe" %% "play-plugins-mailer" % "2.0.4"
)
And play.plugins
1500:com.typesafe.plugin.CommonsMailerPlugin
As I said, the project compiles ok when using play compile, it’s just Eclipse that shows errors. How can I fix this?
Here is what I’ve found to be a solution. Do:
And then wait for Eclipse to rebuild the workspace. This should solve any plugin dependencies issues.