Provided a CMS_EMAIL, and CMS_API.process_email (CMS_EMAIL)

This commit is contained in:
2015-06-30 16:11:49 +02:00
parent 8294a47f17
commit 37fa1f6e86
3 changed files with 41 additions and 1 deletions

View File

@@ -162,7 +162,7 @@ feature -- Access
elseif l_output.is_case_insensitive_equal ("@stdout") then
f := io.output
else
create {PLAIN_TEXT_FILE} f.make_with_name (l_output)
create {RAW_FILE} f.make_with_name (l_output)
if not f.exists then
f.create_read_write
f.close

View File

@@ -137,6 +137,28 @@ feature -- Logging
end
end
feature -- Emails
process_email (e: CMS_EMAIL)
-- Process email `e'.
do
reset_error
setup.mailer.safe_process_email (e)
if setup.mailer.has_error then
error_handler.add_custom_error (0, "Mailer error", "Error occurred while processing email.")
end
end
process_emails (lst: ITERABLE [CMS_EMAIL])
-- Process collection of email `lst'.
do
reset_error
setup.mailer.process_emails (lst)
if setup.mailer.has_error then
error_handler.add_custom_error (0, "Mailer error", "Error occurred while processing emails.")
end
end
feature -- Permissions system
user_has_permission (a_user: detachable CMS_USER; a_permission: detachable READABLE_STRING_GENERAL): BOOLEAN

18
src/service/cms_email.e Normal file
View File

@@ -0,0 +1,18 @@
note
description: "CMS interface representing an email to be used with {CMS_API}.process_email (e: CMS_EMAIL)."
date: "$Date$"
revision: "$Revision$"
class
CMS_EMAIL
inherit
NOTIFICATION_EMAIL
create
make
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end