feat: allow html content for notifications (#9613)
* feat: allow passing provider specific metadata to notification module * changed providerContext to snake cased * rename provider_context to content
This commit is contained in:
+24
@@ -85,6 +85,30 @@ moduleIntegrationTestRunner<INotificationModuleService>({
|
||||
)
|
||||
})
|
||||
|
||||
it("should send a notification and don't store the content in the database", async () => {
|
||||
const notification = {
|
||||
to: "admin@medusa.com",
|
||||
template: "signup-template",
|
||||
channel: "email",
|
||||
data: {},
|
||||
content: {
|
||||
html: "<p>Welcome to medusa</p>",
|
||||
},
|
||||
}
|
||||
|
||||
const result = await service.createNotifications(notification)
|
||||
const dbEntry = await service.retrieveNotification(result.id)
|
||||
|
||||
expect(dbEntry).toEqual(
|
||||
expect.objectContaining({
|
||||
provider_id: "test-provider",
|
||||
external_id: "external_id",
|
||||
status: NotificationStatus.SUCCESS,
|
||||
})
|
||||
)
|
||||
expect(dbEntry).not.toHaveProperty("content")
|
||||
})
|
||||
|
||||
it("should emit an event when a notification is created", async () => {
|
||||
const notification = {
|
||||
to: "admin@medusa.com",
|
||||
|
||||
Reference in New Issue
Block a user