<shameless plug>
I wrote a book about combining Stripe and Rails.
https://www.petekeen.net/mastering-modern-payments
</plug>
<shameless plug>
I wrote a book about combining Stripe and Rails.
https://www.petekeen.net/mastering-modern-payments
</plug>
For email you should probably not use Gmail. They have weird limits and you can easily run afoul of them. A better route is something like Mailgun or Mandrill. They're both free for a large number of outgoing sends and have nice logging and tracking options.
I totally agree here. You're also forced to store a password (even if it's app-specific) in plain text, and the tracking/delivery features are non-existent.
The Mandrill API is pretty rad (I'm using it in my Go app) and the tracking, ability to re-send an email from the last 24 hours (on the free plan) and the server-side templates are all very useful.
try:
mandrill_client = mandrill.Mandrill('YOUR_API_KEY')
message = {
'subject': "Hello there.",
'to': [{'email': 'recipient.email@example.com',
'name': 'Recipient Name',
'type': 'to'}],
'from_name': "Matt",
'from_email': "matt@example.com",
}
result = mandrill_client.messages.send(message=message, async=True) // It'll fire it off without waiting, and you can either set up a web-hook *or* manually re-send if it fails via the dashboard if you don't do massive volumes
except mandrill.Error, e:
# Mandrill errors are thrown as exceptions
print 'A mandrill error occurred: %s - %s' % (e.__class__, e)
# A mandrill error occurred: <class 'mandrill.UnknownSubaccountError'> - No subaccount exists with the id 'customer-123'
raise
Pretty simple stuff. Add in some MergeVars (|NAME|, |PURCHASE_ID|) and server-side templates and you can pass whatever is needed to the API without having to keep "content" in your code or pull in an external template (i.e. Jinja).I have a question on HN etiquette re: plugging decorum. I seen a few instances of this in passing, I thought it was cool.
If it was in this instance, for example: What they did was drop the bait. "I wrote a book about combining Stripe and Rails". Then a reply comment, 99% of the time, will ask for them to dish out the link.
If zrail simply mentioned his book on rails and stripe, my curiosity would have compelled me reply to ask for information on his book (and presumably a link). Also I would see his profile and notice he's also an engineer at a large rails site - which makes me want to hear more from him.
Has anyone else here ever seen this and can show examples of it on HN comments?
Is there another reason some HN posters don't do links in comments, even if they are their own projects but on topic?
We are all here because we want profit from what we learn here (either improving our minds, or more rarely our bank balances) - and indeed most of us secretly or less secretly want to follow the freelancer / ebook / SaaS product route.
To be reminded of the existence of the route and that it is not an impassable journey is, infrequently, a good thing IMO