N
Novu•2y ago
Bocorbojon

Send large HTML as payload in the trigger event

Hello, I have a Rails backend which sends emails through Mailgun. My workflow right now is the following: - Define a template as a HTML file with tags. - Render the template as a HTML string and substitute the tags. - Send the HTML string to the Mailgun API, because their API has support for a HTML property which receives HTML strings I saw that Novu supports using triple braces to send dynamic HTML content as the payload, and I sent my HTML string to Novu but got an unexpected provider error with the message: { "body": "{\"errors\":[\"Option Metadata must not exceed 3500 bytes.\",\"Data Data must be no more than 2048 bytes long\"]}", "statusCode": 400 } So, is there a workaround to send large HTML content? I would like to keep my templates configured and rendered in my Rails backend instead of creating layouts on Novu.
14 Replies
Pawan Jain
Pawan Jain•2y ago
Hi @Bocorbojon Did you try with minifying HTML code?
Bocorbojon
BocorbojonOP•2y ago
Hello, working on the same thing today I found out I was all mixed up. That error, the one of the 3500 bytes long, appears in the case that I have a workflow with push step configured and I send a whole HTML as payload. So, to clarify on the problem I have, it is this one: I have a Novu workflow that has push, in-app and email steps configured. My push template has two handlebars variables, {{property_type}} and {{operation_type}}, and the email template gets only one triple handlebar variable, `{{{html_catchment_card}}}. When I send a notification through the trigger event with payload what happens is that the HTML string I am sending in the html_catchment_card variable is far longer than 3500 bytes, and the email channel can handle it just fine, but the push channel finds an error since it isn't capable of handling more than 3500 bytes, even if that channel isn't actually using the html_catchment_card variable. So, the question is, is there a way to send the html_catchment_card variable just to the email channel? Maybe with the overrides object of the trigger event, but as far as I know, it doesn't allow overriding the payload.
Pawan Jain
Pawan Jain•2y ago
Hi @Bocorbojon sorry for delayed response. Unfortunately this is not supprted, if you have multiple channel step in workflow then payload variables will be available for all steps @george.d I remember you have been working on similar issue like this where notifications were failing due to large payload size. Do we have different limit for each channel. like @Bocorbojon mentioned that email is working fine but push us failing!
george.d
george.d•2y ago
We had another issue that was resolved. Hey @Bocorbojon are you using the cloud version, if you do, do you have a transaction Id for those failing requests, they may help to look a bit further into the matter.
Pawan Jain
Pawan Jain•2y ago
@Bocorbojon ping
Bocorbojon
BocorbojonOP•2y ago
Yes, I am using the cloud version. One of the failing transactions is 632c2ab4-b1d8-4481-a173-f6ddf2f8cc39
george.d
george.d•2y ago
thanks that helps to look into it 🔥
Pradeep Narayanan
Pradeep Narayanan•2y ago
Hi Support team, I have a request to know whether novu platform support Direct Secure Messaging (often called Direct exchange, or Direct for short) utilizes the Direct Standardâ„¢ The basics of direct message can see in this link ,https://www.healthit.gov/sites/default/files/page/2020-07/0720_Direct%20Secure%20Messaging%20Basics.pdf
Pawan Jain
Pawan Jain•2y ago
Hi @pradeepcdlm Novu does not support Direct Secure Messaging. Would you like to share how you are using this in your organisation?
Pradeep Narayanan
Pradeep Narayanan•2y ago
it's not yet use in my organization, I'm doing a R&D of integration with EMR Direct , see https://www.emrdirect.com/about-directed-exchange-and-secure-direct-messaging.html This is a special protocol that encrypt the message to make it secure to send the receiving side, only the receiving side can decrypt the message.
Pawan Jain
Pawan Jain•2y ago
@Engineering WDYT, can Novu support this type of provider?
Zac Clifton
Zac Clifton•2y ago
I think this is a bit out of scope for us at this moment, but I do think it is worth putting into our backlog to look at. @pradeepcdlm Feel free to put in a feature request here https://roadmap.novu.co/roadmap After looking into this, we can support this as it has a node sdk however we would have to implement this in a closed source way as its own provider which we have not done as of this time. This is something we would be happy to do if there is enough demand but other things are higher priority.
Pradeep Narayanan
Pradeep Narayanan•2y ago
Okay thanks, this is mostly used in healthcare data exchange.
Zac Clifton
Zac Clifton•2y ago
Is there any other system that is mostly used in healthcare that we could look at integrating with?
Want results from more Discord servers?
Add your server