merge regionalisation
[auf_rh_dae.git] / project / dae / mail.py
CommitLineData
0f22933b
EMS
1# encoding: utf-8
2
75f0e87b 3from django.conf import settings
0f22933b
EMS
4from django.core.mail import send_mail
5from django.core.urlresolvers import reverse
75f0e87b
DB
6
7from project.dae.workflow import grp_drh
0f22933b 8
80b95abf 9
0f22933b
EMS
10def 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)]
80b95abf 24 send_mail(subject, message, settings.SERVER_EMAIL, recipients)