Playframework 2.0 如何使用Play 2.0将HTML电子邮件重定向到客户端浏览器
注册过程完成后,我会从我的Play应用程序发送欢迎电子邮件。。。我希望能够在客户端的web浏览器中查看其内容。我试过这样的东西Playframework 2.0 如何使用Play 2.0将HTML电子邮件重定向到客户端浏览器,playframework-2.0,Playframework 2.0,注册过程完成后,我会从我的Play应用程序发送欢迎电子邮件。。。我希望能够在客户端的web浏览器中查看其内容。我试过这样的东西 @(title: String)(content: Html) ... <html> <head> <title>@title</title> ... </head> ... <p>Trouble viewing this
@(title: String)(content: Html)
...
<html>
<head>
<title>@title</title>
...
</head>
...
<p>Trouble viewing this email? <a href="@views.html.emails.email(title)(content)">View in Browser</p>
...
<body>
@content
</body>
</html>
@(标题:字符串)(内容:Html)
...
@头衔
...
...
查看此电子邮件时遇到问题?在浏览器中查看
...
@内容
。。。但此代码总是以[StackOverflowerError:null]结尾:
In /home/j3d/Projects/test/app/views/mails/email.scala.html at line 8.
5 <html>
6 <head>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8 <title>@title</title>
9 <style type="text/css">
10 a { color: #4A72AF; }
11 body, #header h1, #header h2, p { margin: 0; padding: 0; }
12 #main { border: 1px solid #cfcece; }
第8行的/home/j3d/Projects/test/app/views/mail/email.scala.html中的。
5.
6.
7.
8@title
9
10 a{color:#4A72AF;}
11正文,标题h1,标题h2,p{边距:0;填充:0;}
12#主{边框:1px实心#cfece;}
任何帮助都将不胜感激:-)
谢谢。显然,您的
@title
为空,请确保控制器中的字符串具有值或在视图中为其设置一些默认值:
@(title: String="Email was sent, check your mailbox")(content: Html)
我认为您正在将您的电子邮件模板包含在
a href=”“
中,而不是将链接放在此页面上
显示视图.html.emails.email
视图,其中包括视图.html.emails.email
视图,其中包括视图.html.emails.email
视图。。。你已经明白了;)
解决方案是在a
标签中放置一个真正的链接(而不是内容)。类似的情况(我不知道您的控制器/路线):
<a href="@routes.Emails.showEmailAction(....)">