diff --git a/bda/templates/bda/mails/buy-shotgun.txt b/bda/templates/bda/mails/buy-shotgun.txt new file mode 100644 index 00000000..d06e0a39 --- /dev/null +++ b/bda/templates/bda/mails/buy-shotgun.txt @@ -0,0 +1,6 @@ +Bonjour {{ vendeur.first_name }} ! + +Je souhaiterais racheter ta place pour {{ spectacle.title }} le {{ spectacle.date_no_seconds }} ({{ spectacle.location }}) à {{ spectacle.price|floatformat:2 }}€. +Contacte-moi si tu es toujours intéressé·e ! + +{{ acheteur.get_full_name }} ({{ acheteur.email }}) diff --git a/bda/views.py b/bda/views.py index fb183d6c..28e8054e 100644 --- a/bda/views.py +++ b/bda/views.py @@ -471,14 +471,11 @@ def buy_revente(request, spectacle_id): revente = random.choice(reventes_shotgun) revente.soldTo = participant revente.save() - mail = """Bonjour ! - -Je souhaiterais racheter ta place pour %s le %s (%s) à %.02f€. -Contacte-moi si tu es toujours intéressé·e ! - -%s (%s)""" % (spectacle.title, spectacle.date_no_seconds(), - spectacle.location, spectacle.price, - request.user.get_full_name(), request.user.email) + mail = loader.render_to_string('bda/mails/buy-shotgun.txt', { + 'spectacle': spectacle, + 'acheteur': request.user, + 'vendeur': revente.seller.user, + }) send_mail("BdA-Revente : %s" % spectacle.title, mail, request.user.email, [revente.seller.user.email],