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)
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)
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
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
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)
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)
def from_address(self): return prefs.getClerksOfficeEmail()
def recipient_address(self): return prefs.getClerksOfficeEmail()
def clerk_email(self): return globalsettings.getClerksOfficeEmail()