Updated CMS code.
Separated code to have a lib and an example. Improved design, fixed a few issues related to folder location. This is still experimental and require more work to be really friendly to use.
This commit is contained in:
48
draft/application/cms/src/notification/cms_mailer.e
Normal file
48
draft/application/cms/src/notification/cms_mailer.e
Normal file
@@ -0,0 +1,48 @@
|
||||
note
|
||||
description : "[
|
||||
Component responsible to send email
|
||||
]"
|
||||
author : "$Author$"
|
||||
date : "$Date$"
|
||||
revision : "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_MAILER
|
||||
|
||||
feature -- Status
|
||||
|
||||
is_available: BOOLEAN
|
||||
-- Is mailer available to use?
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Basic operation
|
||||
|
||||
process_emails (lst: ITERABLE [CMS_EMAIL])
|
||||
-- Process set of emails `lst'
|
||||
require
|
||||
is_available
|
||||
do
|
||||
across
|
||||
lst as c
|
||||
loop
|
||||
process_email (c.item)
|
||||
end
|
||||
end
|
||||
|
||||
safe_process_email (a_email: CMS_EMAIL)
|
||||
-- Same as `process_email', but include the check of `is_available'
|
||||
do
|
||||
if is_available then
|
||||
process_email (a_email)
|
||||
end
|
||||
end
|
||||
|
||||
process_email (a_email: CMS_EMAIL)
|
||||
-- Process the sending of `a_email'
|
||||
require
|
||||
is_available
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user