Example #1
0
def notify(data,d):
    if not 'epdoc' in data: return
    m=db.notifications.find({'dossiers': data['epdoc']},['active_emails'])
    for g in m:
        if len(g['active_emails'])==0:
            continue
        msg = Message("[PT-Com] %s: %s" %
                      (data['committee'],
                       data['title']),
                      sender = "*****@*****.**",
                      bcc = g['active_emails'])
        msg.body = (u"Parltrack has detected %s%s on the schedule of %s \n"
                    u"\n  on %s"
                    u"\n%s"
                    u"%s"
                    u"\nsee the details here: %s\n"
                    u"\nYour Parltrack team" %
                    (u"a change on " if d else u'',
                     data['epdoc'],
                     data['committee'],
                     data['date'] if 'date' in data else 'unknown date',
                     ("\n  - %s" % u'\n  - '.join(data['list'])) if 'list' in data and len(data['list'])>0 else u"",
                     "\n %s" % (textdiff(d) if d else ''),
                     "%s/dossier/%s" % (ROOT_URL, data['epdoc']),
                    ))
        mail.send(msg)
Example #2
0
def makemsg(data, d):
    return (u"Parltrack has detected a change in %s %s on OEIL.\n\nPlease follow this URL: %s/dossier/%s to see the dossier.\n\nChanges follow\n%s\n\n\nsincerly,\nYour Parltrack team" %
            (data['procedure']['reference'],
             data['procedure']['title'],
             ROOT_URL,
             data['procedure']['reference'],
             textdiff(d)))
Example #3
0
def makemsg(data, d):
    return (
        u"Parltrack has detected a change in %s %s on OEIL.\n\nPlease follow this URL: %s/dossier/%s to see the dossier.\n\nChanges follow\n%s\n\n\nsincerly,\nYour Parltrack team"
        % (data['procedure']['reference'], data['procedure']['title'],
           ROOT_URL, data['procedure']['reference'], textdiff(d)))