This file contains 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
sealed trait IOToolResponse[+A] { | |
def flatMap[B](f: A => IOToolResponse[B]): IOToolResponse[B] | |
def map[B](f: A => B): IOToolResponse[B] = this.flatMap(a => IOToolResponse.unit(f(a))) | |
} | |
object IOToolResponse { | |
def unit[A](a: A): IOToolResponse[A] = Authenticated(a) | |
} | |
case class Authenticated[A](data: A) extends IOToolResponse[A] { | |
def flatMap[B](f: A => IOToolResponse[B]) = f(data) |
This file contains 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
package utils | |
import javax.mail.internet.InternetAddress | |
import javax.mail.util.ByteArrayDataSource | |
import org.apache.commons.mail._ | |
import scala.util.{Try, Failure, Success} | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future |