Files
medusa-store/www/apps/docs/content/references/services/classes/Notification.mdx
Shahed Nasser c51dce164d docs: general fixes to references (#5653)
* fixed typedoc plugin's escape strategy

* move props comments to the associated property

* regenerate references
2023-11-17 19:36:58 +02:00

180 lines
4.4 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# Notification
A notification is an alert sent, typically to customers, using the installed Notification Provider as a reaction to internal events such as `order.placed`. Notifications can be resent.
## Constructors
### constructor
`**new Notification**()`
A notification is an alert sent, typically to customers, using the installed Notification Provider as a reaction to internal events such as `order.placed`. Notifications can be resent.
## Properties
<ParameterTypes parameters={[
{
"name": "created_at",
"type": "`Date`",
"description": "The date with timezone at which the resource was created.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "customer",
"type": "[Customer](Customer.mdx)",
"description": "The details of the customer that this notification was sent to.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "customer_id",
"type": "`null` \\| `string`",
"description": "The ID of the customer that this notification was sent to.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "data",
"type": "`Record<string, unknown>`",
"description": "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "event_name",
"type": "`string`",
"description": "The name of the event that the notification was sent for.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "id",
"type": "`string`",
"description": "The notification's ID",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "parent_id",
"type": "`string`",
"description": "The notification's parent ID",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "parent_notification",
"type": "[Notification](Notification.mdx)",
"description": "The details of the parent notification.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "provider",
"type": "[NotificationProvider](NotificationProvider.mdx)",
"description": "The notification provider used to send the notification.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "provider_id",
"type": "`string`",
"description": "The ID of the notification provider used to send the notification.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "resends",
"type": "[Notification](Notification.mdx)[]",
"description": "The details of all resends of the notification.",
"optional": false,
"defaultValue": "",
"expandable": true,
"children": []
},
{
"name": "resource_id",
"type": "`string`",
"description": "The ID of the resource that the Notification refers to.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "resource_type",
"type": "`string`",
"description": "The type of resource that the Notification refers to.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "to",
"type": "`string`",
"description": "The address that the Notification was sent to. This will usually be an email address, but can represent other addresses such as a chat bot user ID.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "updated_at",
"type": "`Date`",
"description": "The date with timezone at which the resource was updated.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
## Methods
### beforeInsert
`Private **beforeInsert**(): void`
#### Returns
`void`
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />