Last active
January 18, 2016 09:37
-
-
Save momota10/761d288466298e5fae6f to your computer and use it in GitHub Desktop.
play-mailerを使ったメール送信メソッド
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sendEmail = Action.async { implicit request => | |
| emailAddressForm.bindFromRequest.fold( | |
| error => { | |
| Future.successful(BadRequest("Your Aoolication")) | |
| }, | |
| emailAddress => { | |
| //mail transfer process | |
| val email = Email( | |
| "Simple email", | |
| "title <aaa@hoge.com>", | |
| Seq(""+ emailAddress.email +" <"+ emailAddress.email +">"), | |
| bodyHtml = Some( | |
| "早安<br>" + | |
| "我想吃魯肉飯" | |
| ) | |
| ) | |
| mailer.send(email) | |
| Future.successful(Ok(views.html.index("Your new application is ready."))) | |
| } | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment