NovuN
Novu2y ago
Mati OS

Override providers from nodejs code

Hola!

I have a few email and sms providers configured in the Novu dashboard. Also I have 2 different workflows, one for email and one for sms.
I want to pick the provider used in the workflow from my nodejs code.

  await novu.trigger('email-workflow', {
    to: {
      subscriberId,
      email: 'mati@mail.com',
    },
    overrides: {
      email: {
        integrationIdentifier: "brevo-abcdef" // Is this line used to change the email provider?
      },
    },
    payload: {},
  });


I want to know if can use integrationIdentifier to pick different channel providers. I want to use for example
  await novu.trigger('sms-workflow', {
    to: {
      subscriberId,
      phone: '+13603963366',
    },
    overrides: {
      sms: {
        integrationIdentifier: "ntrbp-abcdef" // Can I use this to change sms provider?
      },
    },
    payload: {},
  });
Was this page helpful?