diff --git a/src/bda/plone/shop/mailnotify.py b/src/bda/plone/shop/mailnotify.py index ad05091..50dc70d 100644 --- a/src/bda/plone/shop/mailnotify.py +++ b/src/bda/plone/shop/mailnotify.py @@ -25,16 +25,16 @@ def __init__(self, context): @property def admin_email(self): - props = api.portal.get_tool("portal_properties") - return get_shop_settings().admin_email or getattr( - props.site_properties, "email_from_address", "" + return ( + get_shop_settings().admin_email + or api.portal.get_registry_record("plone.email_from_address") ) @property def admin_name(self): - props = api.portal.get_tool("portal_properties") - return get_shop_settings().admin_name or getattr( - props.site_properties, "email_from_name", "" + return ( + get_shop_settings().admin_name + or api.portal.get_registry_record("plone.email_from_name") ) @@ -89,8 +89,7 @@ def _lookup_text(self, field): enum = getattr(settings, field, None) if enum is None: return - portal_state = self.context.restrictedTraverse("@@plone_portal_state") - lang = portal_state.language() + lang = api.portal.get_current_language() for entry in enum: if entry["lang"] == lang: return entry["text"] @@ -142,8 +141,7 @@ def __init__(self, context): def payment_text(self, payment): settings = get_shop_payment_settings() - portal_state = self.context.restrictedTraverse("@@plone_portal_state") - lang = portal_state.language() + lang = api.portal.get_current_language() for entry in settings.payment_text: if entry["lang"] == lang and entry["payment"] == payment: return entry["text"]