PEP8
[auf_rh_dae.git] / project / dae / mail.py
CommitLineData
0f22933b
EMS
1# encoding: utf-8
2
3from django.core.mail import send_mail
4from django.core.urlresolvers import reverse
80b95abf 5from django.conf import settings
0f22933b
EMS
6from dae.workflow import grp_drh
7
80b95abf 8
0f22933b
EMS
9def send_drh_finalisation_mail(request, dossier):
10 subject = 'DAE: contrat pour %s' % dossier
11 dossier_url = request.build_absolute_uri(
12 reverse('embauche_consulter', kwargs={'dossier_id': dossier.id})
13 )
14 message = '\n'.join([
15 'Le contrat pour la DAE %s a été validé' % dossier,
16 '',
17 'Implantation: %s' % dossier.poste.implantation,
18 'Poste: %s' % dossier.poste,
19 '',
20 dossier_url
21 ])
22 recipients = [u.email for u in grp_drh.user_set.filter(is_active=True)]
80b95abf 23 send_mail(subject, message, settings.SERVER_EMAIL, recipients)