diff --git a/gestion/mail/convocation_ago.py b/gestion/mail/convocation_ago.py new file mode 100755 index 00000000..e45cd5d5 --- /dev/null +++ b/gestion/mail/convocation_ago.py @@ -0,0 +1,52 @@ +#!/bin/bash /usr/scripts/python.sh +# -*- coding: utf-8 -*- + +import sys +import smtplib +from gestion import config +from gestion.affich_tools import cprint +from gestion import mail +import lc_ldap.shortcuts +from utils.sendmail import actually_sendmail + +# Attention, si à True envoie effectivement les mails +SEND=('--do-it' in sys.argv) +# Prévisualisation +PREV=('--prev' in sys.argv) + +ldap_filter=u"(&(paiement=%(annee)s)(aid=*))" % {'annee': config.ann_scol} +#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): + if 'canonicalAlias' in adh.attrs.keys(): + mailaddrs.add(str(adh['canonicalAlias'][0])) + elif 'mail' in adh.attrs.keys(): + mailaddrs.add(str(adh['mail'][0])) + elif 'uid' in adh.attrs.keys(): + mailaddrs.add(str(adh['uid'][0]) + '@crans.org') + else: + raise ValueError("%r has nor mail nor canonicalAlias, only %s" % (adh, adh.attrs.keys())) + +echecs=[] +From = 'ca@crans.org' +for To in mailaddrs: + cprint(u"Envoi du mail à %s" % To) + mailtxt=mail.generate('ago', {'To':To, 'From': From}) + if PREV: + print mailtxt.as_string() + try: + if SEND: + actually_sendmail('ca@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 diff --git a/gestion/mail/template/ago/From/fr b/gestion/mail/template/ago/From/fr new file mode 100644 index 00000000..2510ed39 --- /dev/null +++ b/gestion/mail/template/ago/From/fr @@ -0,0 +1 @@ +Le CA du Crans <{{From}}> diff --git a/gestion/mail/template/ago/Subject/fr b/gestion/mail/template/ago/Subject/fr new file mode 100644 index 00000000..00799112 --- /dev/null +++ b/gestion/mail/template/ago/Subject/fr @@ -0,0 +1 @@ +[Crans] Convocation à l'Assemblée Générale Ordinaire de l'association diff --git a/gestion/mail/template/ago/To/fr b/gestion/mail/template/ago/To/fr new file mode 100644 index 00000000..38476730 --- /dev/null +++ b/gestion/mail/template/ago/To/fr @@ -0,0 +1 @@ +{{To}} diff --git a/gestion/mail/template/ago/body/ATTENTION b/gestion/mail/template/ago/body/ATTENTION new file mode 100644 index 00000000..1344cdb0 --- /dev/null +++ b/gestion/mail/template/ago/body/ATTENTION @@ -0,0 +1,3 @@ +Le corps des messages est rédigé en markdown +cd http://tmpvar.com/markdown.html pour un aperçu +du rendu. diff --git a/gestion/mail/template/ago/body/en.md b/gestion/mail/template/ago/body/en.md new file mode 100644 index 00000000..fc4acf67 --- /dev/null +++ b/gestion/mail/template/ago/body/en.md @@ -0,0 +1,37 @@ +Dear members, + +The Ordinary General Meeting of the Cr@ns will take place Thursday, March 6th, 2014 at 7:15pm in Pavillon des Jardins. +The present email serve as formal notice to attend. +The main goal of this meeting is the election of a new Board of Directors. + += Agenda = + +== New statutes and Internal regulation == +Both statutes and internal regulation have been modified. First drafts will soon be available on the wiki. +Final versions will be available Thursday, February 27th after the last meeting of the current members from the Board of Directors. New modifications will be submitted to the vote of all members present at the General Meeting. + +== Activity and financial report == +President Ariane Soret will present the activity report. +Treasurer Vincent Guiraud will present the financial report. +Both reports will be submitted to the vote of all present members. + +== Technical report == +Technical Manager Valentin Samir will present the technical report. + +== Elections == +As anounced by the President, the application phase [1] lasts until Thursday, February 27th. The elections shall be held during the Ordinary General Meeting. Execution modalities will be provided later. + +== Counting of votes == + +== Announcement of new Board of Directors == + +During the Ordinary General Meeting, internet connection may be altered. + +After the Ordinary General Meeting, the new Board of Directors will eventually have a meeting. + +Good evening, + +-- +Raphaël-David Lasseri +Secrétaire du Crans +Secretary of Crans Association diff --git a/gestion/mail/template/ago/body/fr.md b/gestion/mail/template/ago/body/fr.md new file mode 100644 index 00000000..04932302 --- /dev/null +++ b/gestion/mail/template/ago/body/fr.md @@ -0,0 +1,45 @@ +Chers adhérents, + +Le Jeudi 6 Mars 2014, à partir de 19h15 au Pavillon Des Jardins aura lieu +l'Assemblée Générale Ordinaire du Crans. Le présent mail tient lieu de +convocation. L'objet principal de cette assemblée sera l'élection du nouveau +Conseil d'Administration. + += Ordre du jour = + +== Nouveaux Status et Règlement Intérieur == +Les Statuts et le Règlement Intérieur ont été modifiés. +Leurs brouillons sont déja disponible sur la mailing list CA +et seront mis en ligne très prochainement sur le wiki. +Leurs versions finales seront disponible le jeudi 27 février à l'issue +du dernier Conseil d'Administration du bureau actuel. +Ces modifications seront soumises au vote des adhérents présents. + +== Bilans moral et financier == +Le président Ariane Soret présentera le bilan moral et le trésorier sortant +Vincent Guiraud présentera le bilan financier. Ces bilans seront soumis au vote +des adhérents présents. + +== Bilan technique == +Le responsable technique en chef Valentin Samir présentera le bilan technique. + +== Elections == +Comme précédemment annoncé par notre président. La phase de candidature [1] est +ouverte jusqu’au jeudi 27 février. Les élections se dérouleront le jour de +l'AGO; les modalités électorales seront communiqués ultérieurement. + +=== Dépouillement des votes === + +=== Annonce du nouveau bureau === + +Durant l'Assemblée Générale Ordinaire la connexion à Internet pourra être altérée. + + +À l'issue de l'Assemblée Générale Ordinaire le nouveau Conseil d'Administration +pourra éventuellement tenir une réunion. + + +Bonne soirée à tous ! + + [1]: https://wiki.crans.org/CransAdministratif/R%C3%A8glementInt%C3%A9rieur +