def published_notify_cp_list(news_item): """Send notification email to the CP list, notifying them that a new News Item has been published. """ body = u""" Dear CPs, a new News Item has been published on eestec.net: %(news_item_title)s %(description)s %(news_item_url)s Best regards, EESTEC IT Team """ body_values = dict( news_item_url=news_item.absolute_url(), description=news_item.description, news_item_title=news_item.title, ) api.portal.send_email( sender=get_portal_from(), recipient=CP_LIST_ADDRESS, subject=u'[CP] [NEWS] %s' % (news_item.title), body=body % body_values)
def published_notify_cp_list(event): """Send notification email to the CP list, notifying them that a new Event has been published. """ body = u""" Dear CPs, a new Event has been published on eestec.net: %(title)s %(description)s %(url)s Best regards, EESTEC IT Team """ body_values = dict(url=event.absolute_url(), description=event.description, title=event.title) api.portal.send_email( sender=get_portal_from(), recipient=CP_LIST_ADDRESS, subject=u"[CP] [EVENTS] %s" % (event.title), body=body % body_values, )
def test_get_portal_from(self): """Test if portal_from email address is correctly formatted.""" from eestec.portal.utils import get_portal_from self.assertEqual( get_portal_from(), 'EESTEC International <*****@*****.**>' )
def published_notify_cp_list(event): """Send notification email to the CP list, notifying them that a new Event has been published. """ body = u""" Dear CPs, a new Event has been published on eestec.net: %(title)s %(description)s %(url)s Best regards, EESTEC IT Team """ body_values = dict( url=event.absolute_url(), description=event.description, title=event.title, ) api.portal.send_email( sender=get_portal_from(), recipient=CP_LIST_ADDRESS, subject=u'[CP] [EVENTS] %s' % (event.title), body=body % body_values)
def cancelled_notify_board(event): """Send notification email to the Board list, notifying them that a new Event has been created. """ body = u""" Dear Board, an Event has been cancelled on eestec.net: %(title)s %(description)s %(url)s Best regards, EESTEC IT Team """ body_values = dict( url=event.absolute_url(), description=event.description, title=event.title, ) api.portal.send_email( sender=get_portal_from(), recipient=BOARD_LIST_ADDRESS, subject=u'[EVENTS][Cancelled] %s' % (event.title), body=body % body_values)
def test_get_portal_from(self): """Test if portal_from email address is correctly formatted.""" from eestec.portal.utils import get_portal_from self.assertEquals(get_portal_from(), 'EESTEC International <*****@*****.**>')