sendNotificationsStep - Medusa Core Workflows Reference
This documentation provides a reference to the sendNotificationsStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step sends one or more notifications.
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { sendNotificationsStep } from "@medusajs/medusa/core-flows"3 4const myWorkflow = createWorkflow(5 "my-workflow",6 () => {7 const data = sendNotificationsStep({8 "to": "{value}",9 "channel": "{value}",10 "template": "{value}"11 })12 }13)
Input#
SendNotificationsStepInput
SendNotificationsStepInputThe notifications to send.
SendNotificationsStepInput
SendNotificationsStepInputto
stringThe address to send the notification to, depending on
the channel. For example, the email address for the email channel.
to
stringchannel
stringThe channel to send the notification through. For example, email
.
channel
stringemail
.template
stringThe ID of the template to use for the notification. This template ID may be defined
in a third-party service used to send the notification.
template
stringdata
Record<string, unknown> | nullOptionalThe data to use in the notification template. This data may be used to personalize
the notification, such as the user's name or the order number.
data
Record<string, unknown> | nullOptionaltrigger_type
string | nullOptionalThe type of trigger that caused the notification to be sent. For example, order_created
.
trigger_type
string | nullOptionalorder_created
.resource_id
string | nullOptionalThe ID of the resource that triggered the notification. For example, the ID of the order
that triggered the notification.
resource_id
string | nullOptionalresource_type
string | nullOptionalThe type of the resource that triggered the notification. For example, order
.
resource_type
string | nullOptionalorder
.receiver_id
string | nullOptionalThe ID of the user receiving the notification.
receiver_id
string | nullOptionaloriginal_notification_id
string | nullOptionalThe ID of the original notification if it's being resent.
original_notification_id
string | nullOptionalidempotency_key
string | nullOptionalA key to ensure that the notification is sent only once. If the notification
is sent multiple times, the key ensures that the notification is sent only once.
idempotency_key
string | nullOptionalOutput#
NotificationDTO[]
NotificationDTO[]
NotificationDTO[]
NotificationDTO[]id
stringThe ID of the notification.
id
stringto
stringThe recipient of the notification. It can be email, phone number, or username, depending on the channel.
to
stringchannel
stringThe channel through which the notification is sent, such as 'email' or 'sms'
channel
stringtemplate
stringThe template name in the provider's system.
template
stringdata
null | Record<string, unknown>The data that gets passed over to the provider for rendering the notification.
data
null | Record<string, unknown>provider_id
stringThe ID of the notification provider.
provider_id
stringprovider
NotificationProviderDTOInformation about the notification provider
provider
NotificationProviderDTOcreated_at
DateThe date and time the notification was created.
created_at
Datestatus
"pending" | "success" | "failure"The status of the notification
status
"pending" | "success" | "failure"from
null | stringOptionalThe sender of the notification. It can be email, phone number, or username, depending on the channel.
from
null | stringOptionalOptional attachments for the notification.
trigger_type
null | stringOptionalThe event name, the workflow, or anything else that can help to identify what triggered the notification.
trigger_type
null | stringOptionalresource_id
null | stringOptionalThe ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI
resource_id
null | stringOptionalresource_type
null | stringOptionalThe type of the resource this notification is for, if applicable, eg. "order"
resource_type
null | stringOptionalreceiver_id
null | stringOptionalThe ID of the customer this notification is for, if applicable.
receiver_id
null | stringOptionaloriginal_notification_id
null | stringOptionalThe original notification, in case this is a retried notification.
original_notification_id
null | stringOptionalexternal_id
null | stringOptionalThe id of the notification in the external system, if applicable
external_id
null | stringOptionalWas this page helpful?