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.
49 lines
784 B
Plaintext
49 lines
784 B
Plaintext
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
|