|
1
|
{"slug":"/references/notification-service","title":"How to Use Notification Module","frontmatter":{"slug":"/references/notification-service","tags":["notification","server","how to"],"sidebar_label":"Use Notification Module","keywords":["notification","provider","integration"]},"toc":[{"title":"Resolve Notification Module's Service","id":"resolve-notification-module-s-service","level":2},{"title":"createNotifications","id":"createnotifications","level":2},{"title":"createNotifications(data, sharedContext?): Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]>","id":"createnotifications-data-sharedcontext-promisenotificationdto","level":3},{"title":"Example","id":"example","level":4},{"title":"Parameters","id":"createnotifications-parameters","level":4},{"title":"Returns","id":"createnotifications-returns","level":4},{"title":"createNotifications(data, sharedContext?): Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","id":"createnotifications-data-sharedcontext-promisenotificationdto-1","level":3},{"title":"Example","id":"example-1","level":4},{"title":"Parameters","id":"createnotifications-parameters-1","level":4},{"title":"Returns","id":"createnotifications-returns-1","level":4},{"title":"listAndCountNotifications","id":"listandcountnotifications","level":2},{"title":"Example","id":"example-2","level":3},{"title":"Parameters","id":"listandcountnotifications-parameters","level":3},{"title":"Returns","id":"listandcountnotifications-returns","level":3},{"title":"listNotifications","id":"listnotifications","level":2},{"title":"Example","id":"example-3","level":3},{"title":"Parameters","id":"listnotifications-parameters","level":3},{"title":"Returns","id":"listnotifications-returns","level":3},{"title":"retrieveNotification","id":"retrievenotification","level":2},{"title":"Example","id":"example-4","level":3},{"title":"Parameters","id":"retrievenotification-parameters","level":3},{"title":"Returns","id":"retrievenotification-returns","level":3}],"blocks":[{"kind":"markdown","html":"In this document, you’ll learn about the different methods in the Notification Module's service and how to use them."},{"kind":"markdown","html":"---"},{"kind":"heading","level":2,"text":"Resolve Notification Module's Service","id":"resolve-notification-module-s-service"},{"kind":"markdown","html":"In your workflow's step, you can resolve the Notification Module's service from the Medusa container:\n\n```ts\nimport { Modules } from \"@medusajs/framework/utils\"\nimport { createStep } from \"@medusajs/framework/workflows-sdk\"\n\nconst step1 = createStep(\n \"step-1\",\n async ({}, { container }) => {\n const notificationModuleService = container.resolve(\n Modules.NOTIFICATION\n )\n \n // TODO use notificationModuleService\n } \n)\n```\n\nYou can then use the Notification Module's service's methods in the step. The rest of this guide details these methods.\n\n---"},{"kind":"heading","level":2,"text":"createNotifications","id":"createnotifications"},{"kind":"heading","level":3,"text":"createNotifications(data, sharedContext?): Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]>","id":"createnotifications-data-sharedcontext-promisenotificationdto"},{"kind":"markdown","html":"This method is used to send multiple notifications and store them in the database."},{"kind":"heading","level":4,"text":"Example","id":"example"},{"kind":"markdown","html":"```ts\nconst notifications = await notificationModuleService.createNotifications([\n {\n to: \"john@doe.me\",\n template: \"order-confirmation\",\n channel: \"email\",\n },\n {\n to: \"+38975123456\",\n template: \"order-confirmation\",\n channel: \"sms\",\n },\n])\n```"},{"kind":"heading","level":4,"text":"Parameters","id":"createnotifications-parameters"},{"kind":"typeList","sectionTitle":"createNotifications","types":[{"name":"data","type":"[CreateNotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.CreateNotificationDTO)[]","description":"The notifications to be sent.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"to","type":"`string`","description":"The recipient of the notification. It can be email, phone number, or username, depending on the channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`null` \\| `string`","description":"The sender of the notification. It can be email, phone number, or username, depending on the channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"channel","type":"`string`","description":"The channel through which the notification is sent, such as `email` or `sms`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`null` \\| `string`","description":"The template name in the provider's system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"The data that gets passed over to the provider for rendering the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data specific to the provider or channel. For example, cc and bcc for emails.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`null` \\| [NotificationContent](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationContent)","description":"The content that gets passed over to the provider.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"subject","type":"`string`","description":"the subject of the notification","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"text","type":"`string`","description":"the text content of the notification","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"html","type":"`string`","description":"the html content of the notification","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"trigger_type","type":"`null` \\| `string`","description":"The event name, the workflow, or anything else that can help to identify what triggered the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`null` \\| `string`","description":"The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI.\nFor example, the ID of the order if the notification is related to an order update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`null` \\| `string`","description":"The type of the resource this notification is for, if applicable. For example, `order` if it's related to an order update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`null` \\| `string`","description":"The ID of the customer this notification is for, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_notification_id","type":"`null` \\| `string`","description":"The original notification, in case this is a resent notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotency_key","type":"`null` \\| `string`","description":"An idempotency key that ensures the same notification is not sent multiple times.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attachments","type":"`null` \\| [Attachment](/references/types/NotificationTypes/interfaces/types.NotificationTypes.Attachment)[]","description":"Optional attachments for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"content","type":"`string`","description":"The content of the attachment, encoded as a binary string.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"The filename of the attachment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content_type","type":"`string`","description":"The MIME type of the attachment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disposition","type":"`string`","description":"The disposition of the attachment, For example, \"inline\" or \"attachment\".","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID, if the attachment is meant to be referenced within the body of the message.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](/references/types/interfaces/types.Context)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](/references/types/interfaces/types.IMessageAggregator)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"createnotifications-returns"},{"kind":"typeList","sectionTitle":"createNotifications","types":[{"name":"Promise","type":"Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]>","optional":false,"defaultValue":"","description":"The list of sent notifications.","expandable":false,"children":[{"name":"NotificationDTO[]","type":"[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string`","description":"The recipient of the notification. It can be email, phone number, or username, depending on the channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`null` \\| `string`","description":"The sender of the notification. It can be email, phone number, or username, depending on the channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attachments","type":"`null` \\| [Attachment](/references/types/NotificationTypes/interfaces/types.NotificationTypes.Attachment)[]","description":"Optional attachments for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"content","type":"`string`","description":"The content of the attachment, encoded as a binary string.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"The filename of the attachment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content_type","type":"`string`","description":"The MIME type of the attachment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disposition","type":"`string`","description":"The disposition of the attachment, For example, \"inline\" or \"attachment\".","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID, if the attachment is meant to be referenced within the body of the message.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"channel","type":"`string`","description":"The channel through which the notification is sent, such as 'email' or 'sms'","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string`","description":"The template name in the provider's system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"The data that gets passed over to the provider for rendering the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data specific to the provider or channel. For example, cc and bcc for emails.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`null` \\| `string`","description":"The event name, the workflow, or anything else that can help to identify what triggered the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`null` \\| `string`","description":"The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`null` \\| `string`","description":"The type of the resource this notification is for, if applicable, eg. \"order\"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`null` \\| `string`","description":"The ID of the customer this notification is for, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_notification_id","type":"`null` \\| `string`","description":"The original notification, in case this is a retried notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The id of the notification in the external system, if applicable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[NotificationProviderDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationProviderDTO)","description":"Information about the notification provider","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"A user-friendly name of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"channels","type":"`string`[]","description":"The supported channels by the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`Date`","description":"The date and time the notification was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`\"pending\"` \\| `\"success\"` \\| `\"failure\"`","description":"The status of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":3,"text":"createNotifications(data, sharedContext?): Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","id":"createnotifications-data-sharedcontext-promisenotificationdto-1"},{"kind":"markdown","html":"This method is used to send a notification, and store the request in the database."},{"kind":"heading","level":4,"text":"Example","id":"example-1"},{"kind":"markdown","html":"```ts\nconst notification = await notificationModuleService.createNotifications({\n to: \"john@doe.me\",\n template: \"order-confirmation\",\n channel: \"email\",\n})\n```"},{"kind":"heading","level":4,"text":"Parameters","id":"createnotifications-parameters-1"},{"kind":"typeList","sectionTitle":"createNotifications","types":[{"name":"data","type":"[CreateNotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.CreateNotificationDTO)","description":"The notification to be sent.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"to","type":"`string`","description":"The recipient of the notification. It can be email, phone number, or username, depending on the channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`null` \\| `string`","description":"The sender of the notification. It can be email, phone number, or username, depending on the channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"channel","type":"`string`","description":"The channel through which the notification is sent, such as `email` or `sms`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`null` \\| `string`","description":"The template name in the provider's system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"The data that gets passed over to the provider for rendering the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data specific to the provider or channel. For example, cc and bcc for emails.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`null` \\| [NotificationContent](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationContent)","description":"The content that gets passed over to the provider.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"subject","type":"`string`","description":"the subject of the notification","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"text","type":"`string`","description":"the text content of the notification","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"html","type":"`string`","description":"the html content of the notification","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"trigger_type","type":"`null` \\| `string`","description":"The event name, the workflow, or anything else that can help to identify what triggered the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`null` \\| `string`","description":"The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI.\nFor example, the ID of the order if the notification is related to an order update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`null` \\| `string`","description":"The type of the resource this notification is for, if applicable. For example, `order` if it's related to an order update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`null` \\| `string`","description":"The ID of the customer this notification is for, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_notification_id","type":"`null` \\| `string`","description":"The original notification, in case this is a resent notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotency_key","type":"`null` \\| `string`","description":"An idempotency key that ensures the same notification is not sent multiple times.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attachments","type":"`null` \\| [Attachment](/references/types/NotificationTypes/interfaces/types.NotificationTypes.Attachment)[]","description":"Optional attachments for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"content","type":"`string`","description":"The content of the attachment, encoded as a binary string.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"The filename of the attachment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content_type","type":"`string`","description":"The MIME type of the attachment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disposition","type":"`string`","description":"The disposition of the attachment, For example, \"inline\" or \"attachment\".","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID, if the attachment is meant to be referenced within the body of the message.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](/references/types/interfaces/types.Context)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](/references/types/interfaces/types.IMessageAggregator)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":4,"text":"Returns","id":"createnotifications-returns-1"},{"kind":"typeList","sectionTitle":"createNotifications","types":[{"name":"Promise","type":"Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","optional":false,"defaultValue":"","description":"The sent notification.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string`","description":"The recipient of the notification. It can be email, phone number, or username, depending on the channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`null` \\| `string`","description":"The sender of the notification. It can be email, phone number, or username, depending on the channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attachments","type":"`null` \\| [Attachment](/references/types/NotificationTypes/interfaces/types.NotificationTypes.Attachment)[]","description":"Optional attachments for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"content","type":"`string`","description":"The content of the attachment, encoded as a binary string.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"The filename of the attachment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content_type","type":"`string`","description":"The MIME type of the attachment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disposition","type":"`string`","description":"The disposition of the attachment, For example, \"inline\" or \"attachment\".","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID, if the attachment is meant to be referenced within the body of the message.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"channel","type":"`string`","description":"The channel through which the notification is sent, such as 'email' or 'sms'","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string`","description":"The template name in the provider's system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"The data that gets passed over to the provider for rendering the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data specific to the provider or channel. For example, cc and bcc for emails.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`null` \\| `string`","description":"The event name, the workflow, or anything else that can help to identify what triggered the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`null` \\| `string`","description":"The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`null` \\| `string`","description":"The type of the resource this notification is for, if applicable, eg. \"order\"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`null` \\| `string`","description":"The ID of the customer this notification is for, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_notification_id","type":"`null` \\| `string`","description":"The original notification, in case this is a retried notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The id of the notification in the external system, if applicable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[NotificationProviderDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationProviderDTO)","description":"Information about the notification provider","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"A user-friendly name of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"channels","type":"`string`[]","description":"The supported channels by the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`Date`","description":"The date and time the notification was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`\"pending\"` \\| `\"success\"` \\| `\"failure\"`","description":"The status of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":2,"text":"listAndCountNotifications","id":"listandcountnotifications"},{"kind":"markdown","html":"This method is used to retrieve a paginated list of notifications along with the total count of available notifications satisfying the provided filters."},{"kind":"heading","level":3,"text":"Example","id":"example-2"},{"kind":"markdown","html":"To retrieve a list of notifications using their IDs:\n\n```ts\nconst [notifications, count] =\n await notificationModuleService.listAndCountNotifications({\n id: [\"noti_123\", \"noti_321\"],\n })\n```\n\nTo specify relations that should be retrieved within the notifications:"},{"kind":"note","variant":"note","html":"You can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead."},{"kind":"markdown","html":"```ts\nconst [notifications, count] =\n await notificationModuleService.listAndCountNotifications(\n {\n id: [\"noti_123\", \"noti_321\"],\n },\n {\n relations: [\"provider\"],\n }\n )\n```\n\nBy default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:\n\n```ts\nconst [notifications, count] =\n await notificationModuleService.listAndCountNotifications(\n {\n id: [\"noti_123\", \"noti_321\"],\n },\n {\n relations: [\"provider\"],\n take: 20,\n skip: 2,\n }\n )\n```"},{"kind":"heading","level":3,"text":"Parameters","id":"listandcountnotifications-parameters"},{"kind":"typeList","sectionTitle":"listAndCountNotifications","types":[{"name":"filters","type":"[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)","description":"The filters to apply on the retrieved notifications.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the notifications' attributes, such as trigger types and recipients, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"channel","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the channel through which the notification is sent, such as 'email' or 'sms'","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the template name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the trigger type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the resource that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"T* Filter based on the resource type that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the customer ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string>","description":"Filters a notification based on when it was sent and created in the database","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the notifications' attributes, such as trigger types and recipients, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"channel","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the channel through which the notification is sent, such as 'email' or 'sms'","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the template name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the trigger type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the resource that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"T* Filter based on the resource type that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the customer ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string>","description":"Filters a notification based on when it was sent and created in the database","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"q","type":"`string`","description":"Search through the notifications' attributes, such as trigger types and recipients, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"from","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"channel","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the channel through which the notification is sent, such as 'email' or 'sms'","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"template","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the template name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"trigger_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the trigger type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resource_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the resource that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resource_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"T* Filter based on the resource type that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"receiver_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the customer ID.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"[OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string>","description":"Filters a notification based on when it was sent and created in the database","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"config","type":"[FindConfig](/references/medusa/interfaces/medusa.FindConfig)<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","description":"The configurations determining how the notifications are retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(keyof Entity \\| `string` & `object`)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.\n\nYou can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](/references/medusa/types/medusa.FindConfigOrder)","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__internal","type":"[InternalQueryOptions](/references/medusa/types/medusa.InternalQueryOptions)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"crossModuleJoins","type":"[CrossModuleJoinSpec](/references/medusa/types/medusa.CrossModuleJoinSpec)[]","description":"Cross-module join specifications that allows the graph layer to optimize data fetching.\nThe logic behind what gets passed here is owned by the graph layer, and that layer will ensure\nwe don't break boundaries between modules other than for performance optimizations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](/references/types/interfaces/types.Context)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](/references/types/interfaces/types.IMessageAggregator)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":3,"text":"Returns","id":"listandcountnotifications-returns"},{"kind":"typeList","sectionTitle":"listAndCountNotifications","types":[{"name":"Promise","type":"Promise<[[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[], number]>","optional":false,"defaultValue":"","description":"The list of notifications along with the total count.","expandable":false,"children":[{"name":"NotificationDTO[]","type":"[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"number","type":"`number`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":2,"text":"listNotifications","id":"listnotifications"},{"kind":"markdown","html":"This method is used to retrieve a paginated list of notifications based on optional filters and configuration."},{"kind":"heading","level":3,"text":"Example","id":"example-3"},{"kind":"markdown","html":"To retrieve a list of notifications using their IDs:\n\n```ts\nconst notifications = await notificationModuleService.listNotifications({\n id: [\"noti_123\", \"noti_321\"],\n})\n```\n\nTo specify relations that should be retrieved within the notifications:"},{"kind":"note","variant":"note","html":"You can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead."},{"kind":"markdown","html":"```ts\nconst notifications = await notificationModuleService.listNotifications(\n {\n id: [\"noti_123\", \"noti_321\"],\n },\n {\n relations: [\"provider\"],\n }\n)\n```\n\nBy default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:\n\n```ts\nconst notifications = await notificationModuleService.listNotifications(\n {\n id: [\"noti_123\", \"noti_321\"],\n },\n {\n relations: [\"provider\"],\n take: 20,\n skip: 2,\n }\n)\n```"},{"kind":"heading","level":3,"text":"Parameters","id":"listnotifications-parameters"},{"kind":"typeList","sectionTitle":"listNotifications","types":[{"name":"filters","type":"[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)","description":"The filters to apply on the retrieved notifications.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the notifications' attributes, such as trigger types and recipients, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"channel","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the channel through which the notification is sent, such as 'email' or 'sms'","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the template name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the trigger type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the resource that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"T* Filter based on the resource type that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the customer ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string>","description":"Filters a notification based on when it was sent and created in the database","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps) \\| [BaseFilterable](/references/types/DAL/interfaces/types.DAL.BaseFilterable)<[FilterableNotificationProps](/references/types/NotificationTypes/interfaces/types.NotificationTypes.FilterableNotificationProps)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Search through the notifications' attributes, such as trigger types and recipients, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"channel","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the channel through which the notification is sent, such as 'email' or 'sms'","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the template name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the trigger type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the resource that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"T* Filter based on the resource type that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the customer ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string>","description":"Filters a notification based on when it was sent and created in the database","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"q","type":"`string`","description":"Search through the notifications' attributes, such as trigger types and recipients, using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"from","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the recipient of the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"channel","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the channel through which the notification is sent, such as 'email' or 'sms'","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"template","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the template name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"trigger_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the trigger type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resource_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the resource that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resource_type","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"T* Filter based on the resource type that was the trigger for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"receiver_id","type":"`string` \\| `string`[] \\| [OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string \\| string[]>","description":"Filter based on the customer ID.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"[OperatorMap](/references/types/DAL/types/types.DAL.OperatorMap)<string>","description":"Filters a notification based on when it was sent and created in the database","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](/references/types/types/types.Query)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T> \\| [ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](/references/types/types/types.Query)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](/references/types/types/types.ExpandScalar)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"config","type":"[FindConfig](/references/medusa/interfaces/medusa.FindConfig)<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","description":"The configurations determining how the notifications are retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(keyof Entity \\| `string` & `object`)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.\n\nYou can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](/references/medusa/types/medusa.FindConfigOrder)","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__internal","type":"[InternalQueryOptions](/references/medusa/types/medusa.InternalQueryOptions)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"crossModuleJoins","type":"[CrossModuleJoinSpec](/references/medusa/types/medusa.CrossModuleJoinSpec)[]","description":"Cross-module join specifications that allows the graph layer to optimize data fetching.\nThe logic behind what gets passed here is owned by the graph layer, and that layer will ensure\nwe don't break boundaries between modules other than for performance optimizations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](/references/types/interfaces/types.Context)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](/references/types/interfaces/types.IMessageAggregator)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":3,"text":"Returns","id":"listnotifications-returns"},{"kind":"typeList","sectionTitle":"listNotifications","types":[{"name":"Promise","type":"Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]>","optional":false,"defaultValue":"","description":"The list of notifications.","expandable":false,"children":[{"name":"NotificationDTO[]","type":"[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string`","description":"The recipient of the notification. It can be email, phone number, or username, depending on the channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`null` \\| `string`","description":"The sender of the notification. It can be email, phone number, or username, depending on the channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attachments","type":"`null` \\| [Attachment](/references/types/NotificationTypes/interfaces/types.NotificationTypes.Attachment)[]","description":"Optional attachments for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"content","type":"`string`","description":"The content of the attachment, encoded as a binary string.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"The filename of the attachment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content_type","type":"`string`","description":"The MIME type of the attachment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disposition","type":"`string`","description":"The disposition of the attachment, For example, \"inline\" or \"attachment\".","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID, if the attachment is meant to be referenced within the body of the message.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"channel","type":"`string`","description":"The channel through which the notification is sent, such as 'email' or 'sms'","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string`","description":"The template name in the provider's system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"The data that gets passed over to the provider for rendering the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data specific to the provider or channel. For example, cc and bcc for emails.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`null` \\| `string`","description":"The event name, the workflow, or anything else that can help to identify what triggered the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`null` \\| `string`","description":"The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`null` \\| `string`","description":"The type of the resource this notification is for, if applicable, eg. \"order\"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`null` \\| `string`","description":"The ID of the customer this notification is for, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_notification_id","type":"`null` \\| `string`","description":"The original notification, in case this is a retried notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The id of the notification in the external system, if applicable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[NotificationProviderDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationProviderDTO)","description":"Information about the notification provider","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"A user-friendly name of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"channels","type":"`string`[]","description":"The supported channels by the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`Date`","description":"The date and time the notification was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`\"pending\"` \\| `\"success\"` \\| `\"failure\"`","description":"The status of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]},{"kind":"heading","level":2,"text":"retrieveNotification","id":"retrievenotification"},{"kind":"markdown","html":"This method is used to retrieve a notification by its ID"},{"kind":"heading","level":3,"text":"Example","id":"example-4"},{"kind":"markdown","html":"A simple example that retrieves a notification by its ID:\n\n```ts\nconst notification =\n await notificationModuleService.retrieveNotification(\"noti_123\")\n```\n\nTo specify relations that should be retrieved:"},{"kind":"note","variant":"note","html":"You can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead."},{"kind":"markdown","html":"```ts\nconst notification = await notificationModuleService.retrieveNotification(\n \"noti_123\",\n {\n relations: [\"provider\"],\n }\n)\n```"},{"kind":"heading","level":3,"text":"Parameters","id":"retrievenotification-parameters"},{"kind":"typeList","sectionTitle":"retrieveNotification","types":[{"name":"notificationId","type":"`string`","description":"The ID of the notification to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](/references/medusa/interfaces/medusa.FindConfig)<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","description":"The configurations determining how the notification is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(keyof Entity \\| `string` & `object`)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.\n\nYou can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](/references/medusa/types/medusa.FindConfigOrder)","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__internal","type":"[InternalQueryOptions](/references/medusa/types/medusa.InternalQueryOptions)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"crossModuleJoins","type":"[CrossModuleJoinSpec](/references/medusa/types/medusa.CrossModuleJoinSpec)[]","description":"Cross-module join specifications that allows the graph layer to optimize data fetching.\nThe logic behind what gets passed here is owned by the graph layer, and that layer will ensure\nwe don't break boundaries between modules other than for performance optimizations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](/references/types/interfaces/types.Context)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](/references/types/interfaces/types.IMessageAggregator)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"kind":"heading","level":3,"text":"Returns","id":"retrievenotification-returns"},{"kind":"typeList","sectionTitle":"retrieveNotification","types":[{"name":"Promise","type":"Promise<[NotificationDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationDTO)>","optional":false,"defaultValue":"","description":"The retrieved notification.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"to","type":"`string`","description":"The recipient of the notification. It can be email, phone number, or username, depending on the channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"from","type":"`null` \\| `string`","description":"The sender of the notification. It can be email, phone number, or username, depending on the channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attachments","type":"`null` \\| [Attachment](/references/types/NotificationTypes/interfaces/types.NotificationTypes.Attachment)[]","description":"Optional attachments for the notification.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"content","type":"`string`","description":"The content of the attachment, encoded as a binary string.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"The filename of the attachment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content_type","type":"`string`","description":"The MIME type of the attachment.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"disposition","type":"`string`","description":"The disposition of the attachment, For example, \"inline\" or \"attachment\".","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID, if the attachment is meant to be referenced within the body of the message.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"channel","type":"`string`","description":"The channel through which the notification is sent, such as 'email' or 'sms'","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"template","type":"`string`","description":"The template name in the provider's system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"The data that gets passed over to the provider for rendering the notification.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data specific to the provider or channel. For example, cc and bcc for emails.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"trigger_type","type":"`null` \\| `string`","description":"The event name, the workflow, or anything else that can help to identify what triggered the notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_id","type":"`null` \\| `string`","description":"The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resource_type","type":"`null` \\| `string`","description":"The type of the resource this notification is for, if applicable, eg. \"order\"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"receiver_id","type":"`null` \\| `string`","description":"The ID of the customer this notification is for, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"original_notification_id","type":"`null` \\| `string`","description":"The original notification, in case this is a retried notification.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The id of the notification in the external system, if applicable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[NotificationProviderDTO](/references/types/NotificationTypes/interfaces/types.NotificationTypes.NotificationProviderDTO)","description":"Information about the notification provider","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"A user-friendly name of the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"channels","type":"`string`[]","description":"The supported channels by the notification provider.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`Date`","description":"The date and time the notification was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`\"pending\"` \\| `\"success\"` \\| `\"failure\"`","description":"The status of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} |