Mail pour l'AGE avec le pdf des deux textes.
* Bouh, du binaire !
This commit is contained in:
parent
2bbdfc7fc9
commit
dc37719f0d
9 changed files with 140 additions and 0 deletions
67
gestion/mail/convocation_age.py
Executable file
67
gestion/mail/convocation_age.py
Executable file
|
@ -0,0 +1,67 @@
|
|||
#!/bin/bash /usr/scripts/python.sh
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
import smtplib
|
||||
from gestion import config
|
||||
from gestion.affich_tools import cprint
|
||||
from gestion import mail
|
||||
import time
|
||||
import lc_ldap.shortcuts
|
||||
import lc_ldap.crans_utils as crans_utils
|
||||
from email.header import Header
|
||||
from email.mime.application import MIMEApplication
|
||||
from utils.sendmail import actually_sendmail
|
||||
|
||||
STATUTS_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "template/age/statuts.pdf")
|
||||
RI_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "template/age/reglement.pdf")
|
||||
|
||||
# Attention, si à True envoie effectivement les mails
|
||||
SEND=('--do-it' in sys.argv)
|
||||
# Prévisualisation
|
||||
PREV=('--prev' in sys.argv)
|
||||
|
||||
ldap_filter=u"(&(finAdhesion>=%(date)s)(aid=*))" % {'date': crans_utils.to_generalized_time_format(time.time())}
|
||||
#ldap_filter=u"(|(uid=dstan)(uid=lasseri))"
|
||||
|
||||
conn=lc_ldap.shortcuts.lc_ldap_readonly()
|
||||
mailaddrs=set()
|
||||
for adh in conn.search(ldap_filter, sizelimit=2000):
|
||||
_mail = adh.get_mail()
|
||||
if _mail is None:
|
||||
print "%r has no valid contact email." % (adh,)
|
||||
continue
|
||||
mailaddrs.add(str(_mail))
|
||||
|
||||
echecs=[]
|
||||
From = 'ca@crans.org'
|
||||
for To in mailaddrs:
|
||||
cprint(u"Envoi du mail à %s" % To)
|
||||
mailtxt = mail.generate('age', {'To':To, 'From': From})
|
||||
mailtxt["Reply-To"] = Header("ca@crans.org")
|
||||
|
||||
fichier = open(STATUTS_PATH, 'rb')
|
||||
part = MIMEApplication(fichier.read(), 'pdf')
|
||||
part.add_header('Content-Disposition', 'attachment', filename="statuts.pdf")
|
||||
mailtxt.attach(part)
|
||||
fichier = open(RI_PATH, 'rb')
|
||||
part = MIMEApplication(fichier.read(), 'pdf')
|
||||
part.add_header('Content-Disposition', 'attachment', filename="reglement.pdf")
|
||||
mailtxt.attach(part)
|
||||
|
||||
if PREV:
|
||||
print mailtxt.as_string()
|
||||
try:
|
||||
if SEND:
|
||||
actually_sendmail('bureau@crans.org', (To,), mailtxt)
|
||||
cprint(" Envoyé !")
|
||||
else:
|
||||
cprint(" (simulé)")
|
||||
except:
|
||||
cprint(u"Erreur lors de l'envoi à %s " % To, "rouge")
|
||||
echecs.append(To)
|
||||
|
||||
if echecs:
|
||||
print "\nIl y a eu des erreurs :"
|
||||
print echecs
|
1
gestion/mail/template/age/From/fr
Normal file
1
gestion/mail/template/age/From/fr
Normal file
|
@ -0,0 +1 @@
|
|||
Le CA du Crans <{{From}}>
|
1
gestion/mail/template/age/Subject/fr
Normal file
1
gestion/mail/template/age/Subject/fr
Normal file
|
@ -0,0 +1 @@
|
|||
[Crans] Modification des statuts et du règlement intérieur : convocation en assemblée générale extraordinaire.
|
1
gestion/mail/template/age/To/fr
Normal file
1
gestion/mail/template/age/To/fr
Normal file
|
@ -0,0 +1 @@
|
|||
{{To}}
|
1
gestion/mail/template/age/X-Mailer/fr
Normal file
1
gestion/mail/template/age/X-Mailer/fr
Normal file
|
@ -0,0 +1 @@
|
|||
{{ mailer }}
|
32
gestion/mail/template/age/body/en
Normal file
32
gestion/mail/template/age/body/en
Normal file
|
@ -0,0 +1,32 @@
|
|||
Dear members,
|
||||
|
||||
In order to be able to follow ENS Cachan when it'll move to Saclay, Crans need
|
||||
to reform its statutes and rules of procedure.
|
||||
|
||||
We therefore rewrote these texts, as it was an opportunity to clarify the way
|
||||
the association is supposed to work, inside and towards external entities. These
|
||||
new texts explicitly contains a lot of guarantees about how it works, espcially
|
||||
regarding privacy (which tends to become a big deal nowadays).
|
||||
|
||||
Yet, due to timing issues, we need to have an extraordinary assembly to vote
|
||||
these texts on Thursday, July 9th at 7.00 pm (local time). This would allow us
|
||||
to begin some files regarding Saclay project.
|
||||
|
||||
However, we are aware that a lot of our members won't be able to come to vote.
|
||||
Furthermore, these new texts haven't been translated into English for now.
|
||||
Anyway, as it is a duty, these new versions are attached to the current email.
|
||||
If you're interested in, you may contact us in order to ask some questions about
|
||||
these new texts or the assembly. You just need to answer that email.
|
||||
|
||||
Previous versions of statutes and rules of procedure may be found there:
|
||||
https://wiki.crans.org/CransAdministratif/StatutsDuCrans
|
||||
https://wiki.crans.org/CransAdministratif/R%C3%A8glementInt%C3%A9rieur
|
||||
|
||||
The votes will occur all the day in Hall Villon, starting at 9.00 am (local
|
||||
time). The assembly will be held in Amphithéâtre Tocqueville, and its goal will
|
||||
be to account the votes of the day.
|
||||
|
||||
Sincerely,
|
||||
|
||||
--
|
||||
Crans active members
|
37
gestion/mail/template/age/body/fr
Normal file
37
gestion/mail/template/age/body/fr
Normal file
|
@ -0,0 +1,37 @@
|
|||
Chers adhérents,
|
||||
|
||||
Dans le but de pouvoir nous investir dans le projet Paris-Saclay et ainsi
|
||||
accompagner le déménagement de l'Ecole Normale Supérieure de Cachan,
|
||||
l'association doit adapter ses statuts et son règlement intérieur.
|
||||
|
||||
Nous avons donc travaillé à leur réécriture, qui vise aussi à clarifier la façon
|
||||
dont l'association fonctionne, aussi bien en interne que vers les personnes
|
||||
extérieures à l'association. Ainsi un certain nombre de garanties sont désormais
|
||||
exprimées explicitement dans les statuts ou le règlement intérieur, en
|
||||
particulier sur la notion de vie privée (qui est en ce moment au cœur des débats
|
||||
publics).
|
||||
|
||||
Cependant, le temps manque, et nous aimerions pouvoir également mener les
|
||||
démarches nécessaires dans le cadre du projet Saclay, y compris auprès des
|
||||
établissements publics concernés. Aussi, nous souhaiterions voter ces
|
||||
modifications lors d'une Assemblée Générale Extraordinaire qui se tiendrait le
|
||||
jeudi 9 juillet 2015 à 19h.
|
||||
|
||||
Nous avons conscience que ce choix signifie aussi qu'un certain nombre d'entre
|
||||
vous ne pourront pas nécessairement être présents. Les textes que nous
|
||||
souhaitons adopter sont en pièce jointe du présent email. Si vous voyez des
|
||||
choses qui vous semblent problématiques dans l'un d'entre eux, n'hésitez pas à
|
||||
nous contacter par email (en répondant à celui-ci) pour exprimer votre pensée.
|
||||
|
||||
Les précédents statuts et règlement intérieur peuvent être trouvés ici :
|
||||
https://wiki.crans.org/CransAdministratif/StatutsDuCrans
|
||||
https://wiki.crans.org/CransAdministratif/R%C3%A8glementInt%C3%A9rieur
|
||||
|
||||
Vous pourrez vous rendre au Hall Villon à partir de 9h (heure locale) pour voter
|
||||
concernant l'adoption des nouveaux textes. L'assemblée se tiendra à
|
||||
l'amphithéâtre Tocqueville dans le but de dépouiller les votes.
|
||||
|
||||
Bien cordialement,
|
||||
|
||||
--
|
||||
Les membres actifs du Crans
|
BIN
gestion/mail/template/age/reglement.pdf
Normal file
BIN
gestion/mail/template/age/reglement.pdf
Normal file
Binary file not shown.
BIN
gestion/mail/template/age/statuts.pdf
Normal file
BIN
gestion/mail/template/age/statuts.pdf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue