docs/guides/use-cases/transactional-notifications.mdx
Send transactional notifications through Novu by triggering a workflow when a business event occurs in your application. Novu delivers the message across in-app, email, SMS, push, or chat based on your workflow steps and the subscriber's contact details.
Common transactional events include order confirmations, shipping updates, payment failures, and subscription renewals.
subscriberId, email, and phone.subscriberId, and event payload.const novu = new Novu({ secretKey: process.env.NOVU_SECRET_KEY });
await novu.trigger({ workflowId: 'order-shipped', to: { subscriberId: 'user_123' }, payload: { orderId: 'ORD-456', trackingUrl: 'https://example.com/track/456', }, });
</Tab>
<Tab title="Python">
```python
import os
import novu_py
from novu_py import Novu
with Novu(secret_key=os.getenv("NOVU_SECRET_KEY", "")) as novu:
novu.trigger(trigger_event_request_dto=novu_py.TriggerEventRequestDto(
workflow_id="order-shipped",
to={"subscriber_id": "user_123"},
payload={
"orderId": "ORD-456",
"trackingUrl": "https://example.com/track/456",
},
))
novugo "github.com/novuhq/novu-go"
"github.com/novuhq/novu-go/models/components"
)
s := novugo.New(novugo.WithSecurity(os.Getenv("NOVU_SECRET_KEY")))
_, err := s.Trigger(context.Background(), components.TriggerEventRequestDto{ WorkflowID: "order-shipped", To: components.CreateToSubscriberPayloadDto(components.SubscriberPayloadDto{ SubscriberID: "user_123", }), Payload: map[string]any{ "orderId": "ORD-456", "trackingUrl": "https://example.com/track/456", }, }, nil)
</Tab>
<Tab title="PHP">
```php
use novu;
use novu\Models\Components;
$sdk = novu\Novu::builder()
->setSecurity('<YOUR_SECRET_KEY_HERE>')
->build();
$sdk->trigger(
triggerEventRequestDto: new Components\TriggerEventRequestDto(
workflowId: 'order-shipped',
to: new Components\SubscriberPayloadDto(subscriberId: 'user_123'),
payload: [
'orderId' => 'ORD-456',
'trackingUrl' => 'https://example.com/track/456',
],
),
);
var sdk = new NovuSDK(secretKey: "<YOUR_SECRET_KEY_HERE>");
await sdk.TriggerAsync(triggerEventRequestDto: new TriggerEventRequestDto() { WorkflowId = "order-shipped", To = To.CreateSubscriberPayloadDto(new SubscriberPayloadDto() { SubscriberId = "user_123", }), Payload = new Dictionary<string, object>() { { "orderId", "ORD-456" }, { "trackingUrl", "https://example.com/track/456" }, }, });
</Tab>
<Tab title="Java">
```java
import co.novu.Novu;
import co.novu.models.components.*;
import java.util.Map;
Novu novu = Novu.builder()
.secretKey("<YOUR_SECRET_KEY_HERE>")
.build();
novu.trigger()
.body(TriggerEventRequestDto.builder()
.workflowId("order-shipped")
.to(To2.of(SubscriberPayloadDto.builder()
.subscriberId("user_123")
.build()))
.payload(Map.ofEntries(
Map.entry("orderId", "ORD-456"),
Map.entry("trackingUrl", "https://example.com/track/456")))
.build())
.call();
| Event type | Recommended channels |
|---|---|
| Order confirmation | Email + in-app |
| Shipping update | Email, SMS, or push |
| Payment failure | Email + in-app, with SMS fallback |
| Password reset | Email (see password reset guide) |