module HSH.Helpers.Email where
import HSH
import Text.StringTemplate.Helpers

newtype PureInput = PureInput { unpureinput :: String }
  deriving (Read,Show)

{- |
  Send an email via mailx.

  For sysadmin steps required for this command to work with most of the work outsourced to gmail, see last three posts in thread

  This assumes a unixy environment, 
mailxEmail emailBody subject recipient = runIO $ echo emailBody -|- mailxCommand
  where mailxCommand = render1 [("subject",subject),("recipient",recipient)]
                               "mailx -s \"$subject$\" $recipient$"