balanced / balanced-dashboard

The Balanced dashboard.
https://dashboard.balancedpayments.com/
Other
2.28k stars 385 forks source link

Email #148

Open mjallday opened 11 years ago

mjallday commented 11 years ago

We need a new way to render and send emails. Ideally we'd render them using the same templates as the rest of the site in order to make it easy for people to contribute changes to the email templates. This is a pre-req for #107.

Issues

mahmoudimus commented 11 years ago

My suggestions:

nodesocket commented 11 years ago

I am huge fan of Mandrill by MailChimp for sending, but mailgun does the same sort of things if we already use them.

mjallday commented 11 years ago

@mahmoudimus agree but need some sort of templating language too. some of @dmdj03 mocks may be too complex to implement in markdown so we may need to fallback to html or create a rule about email complexity.

@nodesocket we already have a local smtp relay that sends via mailgun, we just need some way to render the emails server side and deliver them to localhost:25.

we currently listen to events (callbacks in the Balanced API) which send a json payload of data and then sometimes we fetch additional data from the api to complete rendering of the emails.

nodesocket commented 11 years ago

With Mandrill you create templates just like Mailchimp, and then can inject content into the template via their API. Simply looks like (sorry, PHP example).

MandrillEmail::send("Activate User",
            array(array("email" => "john@doe.com",
                             "name" => "John Doe",
            array(array("name" => "header-content", 
                      "content" => "Activate User"),
        array("name" => "body-html-content",
                    "content" => "<p>Your user account on Commando.io is almost ready, you just need to activate it.</p><p>Please click the link below to activate your user account, and start managing servers easily.</p><p><a href=\"" . $activation_url . "\">" . $activation_url . "</a></p>"),
         array("name" => "button-html-content",
            "content" => MandrillEmail::button($activation_url, "Activate"))),
         array("activate"));
mjallday commented 11 years ago

then we'd need to have people who contribute to the repo learn another templating language. i think if we can find something that renders markdown and handlebars into html templates then we're in a good position since there's only one templating language you need to know to contribute to the entire project. that make sense?

also, by tying it into Mandrill we're creating a dependency on MailChimp. local smtp delivery allows us to keep it loosely coupled between the app and whatever service actually sends the email be it MailChimp/Mailgun or some other service like AWS etc.

nodesocket commented 11 years ago

Mandrill does have an SMTP provider as well, but then you lose all the hotness of template injection, tagging, etc.

I like the idea of having the templates centrally stored, decoupling from the code. E-mail template styles shouldn't be embedded with code. This allows designers to make changes without needing to touch code.

chadwhitacre commented 10 years ago

+1. I gather that chargeback notifications will no longer come through in email? I'll miss those. My personal preference would probably be for something like a weekly summary report of activity across my Balanced account.