lucee.Componentmodels.MailService
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com ---- The ColdBox Mail Service is used to send emails in a fluent and human fashion.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
asyncManager
|
true
|
false
|
|
string
|
defaultProtocol
The default protocol used for sending mail.
|
true
|
false
|
|
struct
|
defaultSettings
Mail Defaults that are used by all mailer protocols.
|
true
|
false
|
|
any
|
inteceptorService
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
mailQueue
The concurrent mail queue used by our scheduler to send asynchronous queued mail tasks.
|
true
|
false
|
|
struct
|
mailers
Collection of mailers used for mailings.
|
true
|
false
|
|
any
|
settings
|
true
|
false
|
|
string
|
tokenMarker
The token marker used for token replacements, default is `@`.
|
true
|
false
|
|
any
|
wirebox
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
string
|
getAsyncManager()
|
struct
|
getDefaultMailer()
Get the default mailer record. |
string
|
getDefaultProtocol()
|
any
|
getDefaultSetting(any setting, [any defaultValue])
Convenience method to get a mail default setting value. |
string
|
getDefaultSettings()
|
string
|
getInteceptorService()
|
string
|
getLog()
|
string
|
getMailQueue()
|
struct
|
getMailer(any name)
Get a mailer record by name. |
string
|
getMailers()
|
array
|
getRegisteredMailers()
Get an array of names of the registered mailers. |
string
|
getSettings()
|
string
|
getTokenMarker()
|
string
|
getWirebox()
|
Mail
|
newMail()
Get a new Mail payload object, just use config() on it to prepare it or pass in all the arguments via this method. |
any
|
onDIComplete()
Prepare the mail services for operation. |
any
|
parseTokens(any mail)
Parse the tokens and do body replacements. |
any
|
processQueue()
This method is called by our scheduling services or can be called manually to process the queue for. |
string
|
queue(any mail)
Queue the mail payload into our asynchronous work queue. |
MailService
|
registerMailer(any name, any class, [struct properties='[runtime expression]'])
Dynamically register a mailer protocol in this mail service. |
MailService
|
registerMailers(struct mailers)
Register a struct of mailers in this mail service according to our convention:. |
Mail
|
send(Mail mail)
Send an email payload and returns to you the payload. |
any
|
sendAsync(any mail)
Send an email payload asynchronously and return a ColdBox Future. |
any
|
setAsyncManager(any asyncManager)
|
any
|
setDefaultProtocol(string defaultProtocol)
|
MailService
|
setDefaultSetting(any setting, [any value])
Convenience method to set a default setting value. |
any
|
setDefaultSettings(struct defaultSettings)
|
any
|
setInteceptorService(any inteceptorService)
|
any
|
setLog(any log)
|
any
|
setMailQueue(any mailQueue)
|
any
|
setMailers(struct mailers)
|
any
|
setSettings(any settings)
|
any
|
setTokenMarker(string tokenMarker)
|
any
|
setWirebox(any wirebox)
|
private MailService
|
storeMailDefaults([any server], [any username], [any password], [numeric port], [any from], [any to], [any body], [any bcc], [any cc], [any charset], [boolean debug='false'], [any failto], [any group], [boolean groupcasesensitive], [any mailerid], [numeric maxrows], [any mimeattach], [any priority], [any query], [any replyto], [boolean spoolenable], [numeric startrow], [any subject], [numeric timeout], [any type], [boolean useSSL], [boolean useTLS], [numeric wraptext])
Store the mail defaults. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- coldbox:asyncManagerserializable
- trueThe default protocol used for sending mail. The default is called `default` :)
access
- publicrequired
- falsereturntype
- anyserializable
- trueMail Defaults that are used by all mailer protocols
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:interceptorServiceserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueThe concurrent mail queue used by our scheduler to send asynchronous queued mail tasks
access
- publicrequired
- falsereturntype
- anyserializable
- trueCollection of mailers used for mailings
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:moduleSettings:cbmailservicesserializable
- trueThe token marker used for token replacements, default is `@`
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
Get the default mailer record
Convenience method to get a mail default setting value
setting
- The setting key to getdefaultValue
- The default value to return if the setting key doesn't existGet a mailer record by name
name
Get an array of names of the registered mailers
Get a new Mail payload object, just use config() on it to prepare it or pass in all the arguments via this method All arguments passed to this method will be bound into the returning Mail object.
Prepare the mail services for operation
Parse the tokens and do body replacements.
mail
- The mail payload to use for parsing and usage.This method is called by our scheduling services or can be called manually to process the queue for mail sending
Queue the mail payload into our asynchronous work queue
mail
- The mail payload to send.Dynamically register a mailer protocol in this mail service
name
- The unique name of the protocolclass
- The protocol alias or wirebox idproperties
- The properties to instantiate the transit protocol withRegister a struct of mailers in this mail service according to our convention:
{ class: "", properties : "" }
mailers
- The structure of mailers to registerSend an email payload and returns to you the payload
mail
- The mail payload to send.Send an email payload asynchronously and return a ColdBox Future
mail
- The mail payload to send.asyncManager
defaultProtocol
Convenience method to set a default setting value
setting
- The setting key to setvalue
- The setting value to setdefaultSettings
inteceptorService
log
mailQueue
mailers
settings
tokenMarker
wirebox
Store the mail defaults
server
username
password
port
from
to
body
bcc
cc
charset
debug
failto
group
groupcasesensitive
mailerid
maxrows
mimeattach
priority
query
replyto
spoolenable
startrow
subject
timeout
type
useSSL
useTLS
wraptext