MailerService
Interface: MailerService
Defined in: packages/core/src/services/mailer.service.ts:37
Represent a mailer service
Extends
Properties
_compiledCapabilities
protected_compiledCapabilities:Record<string,any> ={}
Defined in: packages/core/src/services/iservice.ts:58
Capabilities detected at compile-time from @WebdaCapability-tagged interfaces.
Populated during Service.resolve by reading the service's entry in
webda.module.json. Each key is a capability name (e.g., "request-filter"),
and the value is an empty object {} by default. Override getCapabilities
to provide capability-specific configuration or to conditionally disable capabilities.
See
getCapabilities
Inherited from
NotificationService._compiledCapabilities
name
readonlyname:string
Defined in: packages/core/src/services/iservice.ts:35
Inherited from
parameters
readonlyparameters:ServiceParameters
Defined in: packages/core/src/services/iservice.ts:36
Inherited from
NotificationService.parameters
Methods
addListener()
addListener<
Key>(eventName,listener):this
Defined in: packages/core/src/events/asynceventemitter.ts:83
Type Parameters
Key
Key extends never
Parameters
eventName
Key
the event name
listener
(event) => void | Promise<void>
the event listener
Returns
this
this for chaining
See
EventEmitter.addListener
Inherited from
NotificationService.addListener
emit()
emit<
Key>(eventName,event):Promise<void>
Defined in: packages/core/src/events/asynceventemitter.ts:165
Emit an event for this class
Instead of returning a boolean, this method returns a Promise so you can decide to wait for the event to be processed or not
Type Parameters
Key
Key extends never
Parameters
eventName
Key
the event name
event
object[Key]
the event name
Returns
Promise<void>
See
EventEmitter.emit
Inherited from
getCapabilities()
getCapabilities():
Record<string,any>
Defined in: packages/core/src/services/iservice.ts:86
Return the capabilities of this service.
By default returns capabilities detected at compile-time from
Returns
Record<string, any>
the result
Webda Capability-tagged
interfaces in webda.module.json.
Override to disable capabilities based on configuration:
getCapabilities() {
const caps = super.getCapabilities();
if (!this.parameters.enabled) delete caps["request-filter"];
return caps;
}
Inherited from
NotificationService.getCapabilities
getMaxListeners()
getMaxListeners():
number
Defined in: packages/core/src/events/asynceventemitter.ts:90
Returns
number
Inherited from
NotificationService.getMaxListeners
getName()
abstractgetName():string
Defined in: packages/core/src/services/iservice.ts:107
Get the name of the service
Returns
string
Deprecated
use name directly
Inherited from
getOpenApiReplacements()
abstractgetOpenApiReplacements():object
Defined in: packages/core/src/services/iservice.ts:115
Get OpenAPI replacements
Returns
object
Inherited from
NotificationService.getOpenApiReplacements
getState()
abstractgetState():string
Defined in: packages/core/src/services/iservice.ts:101
Return the state of initialization
Returns
string
Inherited from
handleNotificationFor()
handleNotificationFor(
userOrIdent):Promise<boolean>
Defined in: packages/core/src/services/notificationservice.service.ts:21
Check if the service can deliver notification to this user
Parameters
userOrIdent
Returns
Promise<boolean>
Inherited from
NotificationService.handleNotificationFor
hasNotification()
hasNotification(
notification):Promise<boolean>
Defined in: packages/core/src/services/notificationservice.service.ts:16
Check if this type of notification is available
Parameters
notification
string
Returns
Promise<boolean>
Inherited from
NotificationService.hasNotification
init()
abstractinit():Promise<MailerService>
Defined in: packages/core/src/services/iservice.ts:93
Initialize the service
Returns
Promise<MailerService>
Inherited from
listeners()
listeners(
eventName):Function[]
Defined in: packages/core/src/events/asynceventemitter.ts:183
Get all listeners for an event
Parameters
eventName
never
the event name
Returns
Function[]
the list of results
Inherited from
off()
off<
Key>(eventName,listener):this
Defined in: packages/core/src/events/asynceventemitter.ts:141
Type Parameters
Key
Key extends never
Parameters
eventName
Key
the event name
listener
(event) => void
the event listener
Returns
this
this for chaining
See
EventEmitter.off
Inherited from
on()
on<
Key>(eventName,listener):this
Defined in: packages/core/src/events/asynceventemitter.ts:119
Type Parameters
Key
Key extends never
Parameters
eventName
Key
the event name
listener
(event) => void
the event listener
Returns
this
this for chaining
See
EventEmitter.once
Inherited from
once()
once<
Key>(eventName,listener):this
Defined in: packages/core/src/events/asynceventemitter.ts:108
Type Parameters
Key
Key extends never
Parameters
eventName
Key
the event name
listener
(event) => void
the event listener
Returns
this
this for chaining
See
EventEmitter.once
Inherited from
removeAllListeners()
removeAllListeners<
Key>(eventName?):this
Defined in: packages/core/src/events/asynceventemitter.ts:150
Type Parameters
Key
Key extends never
Parameters
eventName?
Key
the event name
Returns
this
this for chaining
See
EventEmitter.removeAllListeners
Inherited from
NotificationService.removeAllListeners
removeListener()
removeListener<
Key>(eventName,listener):this
Defined in: packages/core/src/events/asynceventemitter.ts:130
Type Parameters
Key
Key extends never
Parameters
eventName
Key
the event name
listener
(event) => void
the event listener
Returns
this
this for chaining
See
EventEmitter.removeListener
Inherited from
NotificationService.removeListener
resolve()
abstractresolve():this
Defined in: packages/core/src/services/iservice.ts:97
All services should be able to resolve themselves
Returns
this
Inherited from
send()
send(
options,callback):Promise<any>
Defined in: packages/core/src/services/mailer.service.ts:45
Send an email
Parameters
options
MailerSendOptions
Options to pass to the sendMail option of the nodemailer module
callback
() => void
Callback to pass to sendMail
Returns
Promise<any>
Promise resolving when the email is sent
sendNotification()
sendNotification(
user,notification,replacements):Promise<void>
Defined in: packages/core/src/services/notificationservice.service.ts:28
Send the notification to the user
Parameters
user
notification
string
replacements
any
Returns
Promise<void>
Inherited from
NotificationService.sendNotification
setMaxListeners()
setMaxListeners(
n):this
Defined in: packages/core/src/events/asynceventemitter.ts:97
Parameters
n
number
Returns
this
Inherited from
NotificationService.setMaxListeners
stop()
abstractstop():Promise<void>
Defined in: packages/core/src/services/iservice.ts:111
Stop the service
Returns
Promise<void>