Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 19 lines (17 sloc) 0.778 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
from google.appengine.api import mail
from google.appengine.ext import deferred

FROM = 'robot@hackerdojo-kudos.appspotmail.com'

def send_kudos_email(kudos, giver, to):
    body = ["You have been praised with %s kudos" % kudos.amount]
    if kudos.reason:
        body.append(" for:\n\n%s\n\n" % kudos.reason)
    else:
        body.append(".\n\n")
    body.append("The Dojo community is better from your efforts.\n\n")
    body.append("http://kudos.hackerdojo.com/kudos/%s" % kudos.key().id())
    mail.send_mail(
        sender="%s <%s>" % (giver.fullname(), FROM),
        to="%s <%s>" % (to.fullname(), to.user.email()),
        reply_to="%s <%s>" % (giver.fullname(), giver.user.email()),
        subject="[Kudos] Thank you from the community",
        body=''.join(body))
Something went wrong with that request. Please try again.