コード例 #1
0
def sendNotificationToClerksOffice(date):
    """
    send a mail to the clerks office with
    stating all questions per ministry that
    are approaching the deadline
    """
    text = translate('notification_email_to_clerk_question_pending_response',
                     target_language='en',
                     domain='bungeni.core',
                     default="Questions pending responses.")
    ministries = _getAllMinistries(date)
    for ministry in ministries:
        questions = _getQuestionsPendingResponse(date, ministry)
        if questions:
            text = text + '\n' + ministry.full_name +': \n'
        for question in questions:
            text = text + question.subject + '\n'
    
    msg = MIMEText(text)
    
    msg['Subject'] = u'Questions pending response'
    msg['From'] = prefs.getAdministratorsEmail()
    msg['To'] = prefs.getClerksOfficeEmail()
    print msg
    # !+SENDMAIL(ah,18-03-2010)
    #Mail sending is commented out below
    dispatch(msg)
コード例 #2
0
def sendNotificationToMinistry(date):
    """
    send a notification to the ministry stating
    all questions that are approaching the deadline
    """
    text = translate("notification_email_to_ministry_question_pending_response",
                     target_language="en",
                     domain="bungeni",
                     default="Questions pending responses.")
    ministries = _getAllMinistries(date)
    for ministry in ministries:
        questions = _getQuestionsPendingResponse(date, ministry)
        text = translate("notification_email_to_ministry_question_pending_response",
                     target_language="en",
                     domain="bungeni",
                     default="Questions assigned to the ministry pending responses.")
        if questions: 
            text = "%s\n%s: \n" % (text, ministry.full_name) + \
                "\n".join([ question.subject for question in questions ])
            emails = [ utils.formatted_user_email(minister)
                for minister in dbutils.get_ministers(ministry) ]
            msg = MIMEText(text)
            msg["Subject"] = "Questions pending response"
            msg["From"] = prefs.getClerksOfficeEmail()
            msg["To"] = " ,".join(emails)
            print msg
            # !+SENDMAIL(ah,18-03-2010)
            #Mail sending is commented out 
            dispatch(msg)
コード例 #3
0
def sendNotificationToMinistry(date):
    """
    send a notification to the ministry stating
    all questions that are approaching the deadline
    """
    text = translate('notification_email_to_ministry_question_pending_response',
                     target_language='en',
                     domain='bungeni.core',
                     default="Questions pending responses.")
    ministries = _getAllMinistries(date)
    for ministry in ministries:
        questions = _getQuestionsPendingResponse(date, ministry)
        text = translate('notification_email_to_ministry_question_pending_response',
                     target_language='en',
                     domain='bungeni.core',
                     default="Questions assigned to the ministry pending responses.")
        if questions: 
            text = text + '\n' + ministry.full_name +': \n'
            for question in questions:
                 text = text + question.subject + '\n'
            emails = dbutils.getMinsiteryEmails(ministry)
            msg = MIMEText(text)
            
            msg['Subject'] = u'Questions pending response'
            msg['From'] = prefs.getClerksOfficeEmail()
            msg['To'] = emails
            print msg
コード例 #4
0
def sendNotificationToMinistry(date):
    """
    send a notification to the ministry stating
    all questions that are approaching the deadline
    """
    text = translate(
        'notification_email_to_ministry_question_pending_response',
        target_language='en',
        domain='bungeni.core',
        default="Questions pending responses.")
    ministries = _getAllMinistries(date)
    for ministry in ministries:
        questions = _getQuestionsPendingResponse(date, ministry)
        text = translate(
            'notification_email_to_ministry_question_pending_response',
            target_language='en',
            domain='bungeni.core',
            default="Questions assigned to the ministry pending responses.")
        if questions:
            text = text + '\n' + ministry.full_name + ': \n'
            for question in questions:
                text = text + question.subject + '\n'
            emails = dbutils.getMinsiteryEmails(ministry)
            msg = MIMEText(text)

            msg['Subject'] = u'Questions pending response'
            msg['From'] = prefs.getClerksOfficeEmail()
            msg['To'] = emails
            print msg
コード例 #5
0
def sendNotificationToMinistry(date):
    """
    send a notification to the ministry stating
    all questions that are approaching the deadline
    """
    text = translate(
        "notification_email_to_ministry_question_pending_response",
        target_language="en",
        domain="bungeni",
        default="Questions pending responses.")
    ministries = _getAllMinistries(date)
    for ministry in ministries:
        questions = _getQuestionsPendingResponse(date, ministry)
        text = translate(
            "notification_email_to_ministry_question_pending_response",
            target_language="en",
            domain="bungeni",
            default="Questions assigned to the ministry pending responses.")
        if questions:
            text = "%s\n%s: \n" % (text, ministry.full_name) + \
                "\n".join([ question.subject for question in questions ])
            emails = [
                utils.formatted_user_email(minister)
                for minister in dbutils.get_ministers(ministry)
            ]
            msg = MIMEText(text)
            msg["Subject"] = "Questions pending response"
            msg["From"] = prefs.getClerksOfficeEmail()
            msg["To"] = " ,".join(emails)
            print msg
            # !+SENDMAIL(ah,18-03-2010)
            #Mail sending is commented out
            dispatch(msg)
コード例 #6
0
def sendNotificationToClerksOffice(date):
    """
    send a mail to the clerks office with
    stating all questions per ministry that
    are approaching the deadline
    """
    text = translate('notification_email_to_clerk_question_pending_response',
                     target_language='en',
                     domain='bungeni.core',
                     default="Questions pending responses.")
    ministries = _getAllMinistries(date)
    for ministry in ministries:
        questions = _getQuestionsPendingResponse(date, ministry)
        if questions:
            text = text + '\n' + ministry.full_name + ': \n'
        for question in questions:
            text = text + question.subject + '\n'

    msg = MIMEText(text)

    msg['Subject'] = u'Questions pending response'
    msg['From'] = prefs.getAdministratorsEmail()
    msg['To'] = prefs.getClerksOfficeEmail()
    print msg
    # !+SENDMAIL(ah,18-03-2010)
    #Mail sending is commented out below
    dispatch(msg)
コード例 #7
0
 def from_address(self):
     return prefs.getClerksOfficeEmail()
コード例 #8
0
 def recipient_address(self):
     return prefs.getClerksOfficeEmail()
コード例 #9
0
ファイル: motion.py プロジェクト: mohalfaki/bungeni-portal
 def from_address(self):
     return prefs.getClerksOfficeEmail()
コード例 #10
0
ファイル: motion.py プロジェクト: mohalfaki/bungeni-portal
 def recipient_address(self):
     return prefs.getClerksOfficeEmail()
コード例 #11
0
 def clerk_email(self):
     return globalsettings.getClerksOfficeEmail()