sendEmailLink :: Upload -> Route App -> Text -> Handler ()
sendEmailLink upload route email = do
    rdr <- getUrlRenderParams
    extra <- getExtra

    let wrappedTitle = wrappedText (uploadTitle upload) 50
        from = Address (Just $ extraAdmin extra) (extraAdminMail extra)
        to   = Address Nothing email
        subject = [st|#{wrappedTitle} | getwebb|]
        text = renderMarkup $ [hamlet|
            A file named #{wrappedTitle} has been send to you via getwebb.org.

            $with Hmac hmacTxt <- uploadHmac upload
                Click here on the following link to download this file:
                @{ViewR hmacTxt}

            Sincerely, the getwebb administrators.
            |] rdr
        html = renderMarkup $ $(hamletFile "templates/email.hamlet") rdr

    liftIO $ simpleMail to from subject text html [] >>= renderSendMail
sendEmailLink :: Upload -> Route App -> Text -> Handler ()
sendEmailLink upload route email = do
    rdr <- getUrlRenderParams
    extra <- getExtra

    let wrappedTitle = wrappedText (uploadTitle upload) 50
        from = Address (Just $ extraAdmin extra) (extraAdminMail extra)
        to   = Address Nothing email
        subject = [st|#{wrappedTitle} | getwebb|]
        text = renderMarkup $ [hamlet|
            A file named #{wrappedTitle} has been send to you via getwebb.org.

            $with Hmac hmacTxt <- uploadHmac upload
                Click here on the following link to download this file:
                @{ViewR hmacTxt}

            Sincerely, the getwebb administrators.
            |] rdr
        html = renderMarkup $ $(hamletFile "templates/email.hamlet") rdr

    liftIO $ simpleMail to from subject text html [] >>= renderSendMail
sendEmailLink upload route email = do
    rdr <- getUrlRenderParams
    extra <- getExtra

    let wrappedTitle = wrappedText (uploadTitle upload) 50
        from = Address (Just $ extraAdmin extra) (extraAdminMail extra)
        to   = Address Nothing email
        subject = [st|#{wrappedTitle} | getwebb|]
        text = renderMarkup $ [hamlet|
            A file named #{wrappedTitle} has been send to you via getwebb.org.

            $with Hmac hmacTxt <- uploadHmac upload
                Click here on the following link to download this file:
                @{ViewR hmacTxt}

            Sincerely, the getwebb administrators.
            |] rdr
        html = renderMarkup $ $(hamletFile "templates/email.hamlet") rdr

    liftIO $ simpleMail to from subject text html [] >>= renderSendMail