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:
Christian
2024-10-18 11:36:22 +02:00
committed by GitHub
parent 2a98be6b65
commit a0b747e117
7 changed files with 121 additions and 2 deletions

View File

@@ -38,6 +38,10 @@ medusaIntegrationTestRunner({
trigger_type: "order-created",
resource_id: "order-id",
resource_type: "order",
content: {
subject: "We received you order",
html: "<p>Thank you<p>",
},
} as CreateNotificationDTO
const result = await service.createNotifications(notification)
@@ -67,6 +71,8 @@ medusaIntegrationTestRunner({
})
)
expect(result).toHaveProperty("content")
expect(fromDB).toEqual(
expect.objectContaining({
to: "test@medusajs.com",
@@ -83,6 +89,8 @@ medusaIntegrationTestRunner({
})
)
expect(fromDB).not.toHaveProperty("content")
expect(logSpy).toHaveBeenCalledWith(
`Attempting to send a notification to: 'test@medusajs.com' on the channel: 'email' with template: 'order-created' and data: '{\"username\":\"john-doe\"}'`
)