Add invitation email template.

[?]
Jul 4, 2015, 12:48 AM
M3KUPGZK2UTW4FG3Q632K7P7MI4FVWD5TTIP45UTI3E72UKOWJBAC

Dependencies

  • [2] 2XQD6KKK Add invitation logic and clean up DBProg error handling.
  • [3] V2VDN77H Enable postgres configuration via environment variable for Heroku.
  • [4] 4ZLEDBK7 Initial attempts at dockerizing, cabal isn't cooperating.
  • [5] O5FVTOM6 Undo JSON silliness, enable a couple more routes.
  • [6] JEOPOOPT Dockerfile now builds correctly.
  • [*] QO4NFWIY Added sample config file.
  • [*] PGZJ736C Update aftok.cfg.example and revise INSTALL instructions
  • [*] PBD7LZYQ Postgres & auth are beginning to function.
  • [*] EQXRXRZD Changed to use tasty instead of test-framework

Change contents

  • replacement in Dockerfile at line 26
    [3.885][3.754:787]()
    # Install the aftok dependencies
    [3.885]
    [3.885]
    # Install and build aftok-server dependencies
  • edit in Dockerfile at line 28
    [3.926]
    [3.926]
    WORKDIR /opt/aftok
  • replacement in Dockerfile at line 30
    [3.943][3.788:871]()
    RUN cd /opt/aftok && cabal install cpphs && cabal install --only-dependencies -j4
    [3.943]
    [3.1024]
    RUN cabal install cpphs
    RUN cabal install --only-dependencies -j4
  • replacement in Dockerfile at line 34
    [3.913][3.1025:1081](),[3.1025][3.1025:1081](),[3.1081][3.914:979]()
    ADD ./lib /opt/aftok/lib
    ADD ./server /opt/aftok/server
    RUN cd /opt/aftok && cabal configure && cabal build aftok-server
    [3.913]
    [3.1081]
    ADD ./lib /opt/aftok/lib
    ADD ./server /opt/aftok/server
    RUN cabal configure && cabal build aftok-server
  • edit in conf/aftok.cfg.example at line 24
    [9.1076]
    sendgridUser = "example"
    sendgridKey = "abcdefg"
    # templatePath = "/opt/aftok/server/templates"
  • replacement in server/Aftok/QConfig.hs at line 41
    [2.7925][2.7925:7968]()
    <*> C.require cfg "templatePath"
    [2.7925]
    [2.7968]
    <*> C.lookupDefault "templatePath" cfg "/opt/aftok/server/templates"
  • replacement in server/Aftok/Snaplet/Projects.hs at line 77
    [2.10124][2.10124:10188]()
    let setAttrs = setAttribute "invCode" (renderInvCode invCode)
    [2.10124]
    [2.10188]
    let setAttrs = setAttribute "from_email" (from' ^. _Email) .
    setAttribute "project_name" pn .
    setAttribute "to_email" (to' ^. _Email) .
    setAttribute "inv_code" (renderInvCode invCode)
  • replacement in server/Aftok/Snaplet/Projects.hs at line 82
    [2.10222][2.10222:10260]()
    { from = unpack $ from' ^. _Email
    [2.10222]
    [2.10260]
    { from = "invitations@aftok.com"
  • file addition: templates (d--r------)
    [11.1243]
  • file addition: invitation_email.st (----------)
    [0.719]
    Hi there!
    A friend of yours ($from_email$") has invited you to join the "$project_name$" project at http://aftok.com. Here's what you need to do to accept their invitation. At present, there's no user interface for the service other than bare HTTP requests with a JSON payload. A script has been provided below that you can edit to include your own information. You'll need to replace the following three tokens:
    USER -- a username of your choosing
    PASS -- the password you want to use for accessing the site
    BTC_ADDR -- the bitcoin address that you want payouts to be initially sent to. You'll be able to change this later, but because changes of payout addresses are validated by checking transactions on the blockchain, it's important that this be a usable address that you control.
    Substitute your own values for the tokens in the script below, then run it! Also, if you'd prefer that a different email address be associated with your account, change that as well.
    curl -k -v -H 'Content-Type: application/json' -d '{"username":"USER", "password":"PASS", "email":"$to_email$", "btcAddr":"BTC_ADDR", "invitation_codes":["$inv_code$"]}' 'https://aftok.com/register'