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