Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for subscriber creation in trigger function #41

Open
prathapbelli opened this issue Jul 7, 2023 · 11 comments
Open

support for subscriber creation in trigger function #41

prathapbelli opened this issue Jul 7, 2023 · 11 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@prathapbelli
Copy link
Contributor

As I read we have node package support for triggering event with subscriber details which basically upsert the subscriber before triggering event.
two modes

  1. Ahead of Trigger
  2. Inline of Trigger
to: {
      subscriberId: '<USER_IDENTIFIER>',
      email: '[email protected]',
      firstName: 'John',
      lastName: 'Doe',
    },

Can we get that Inline of Trigger functionality in python sdk

@ryshu ryshu added enhancement New feature or request good first issue Good for newcomers labels Jul 7, 2023
@unicodeveloper
Copy link
Contributor

@ryshu are you taking this up? this feels very straightforward

@unicodeveloper
Copy link
Contributor

unicodeveloper commented Jul 7, 2023

More thoughts here:

  1. Ahead of trigger means you call the resource to create a subscriber first before you trigger an event. Here you use the SubscriberAPI in this SDK.
  2. Inline of trigger means you trigger the event by passing the subscriber details and Novu creates if the subscriber if it is non-existent. @ryshu is that not what the EventApi currently does?

@ryshu
Copy link
Collaborator

ryshu commented Jul 7, 2023

@unicodeveloper

The API doesn't support it today, because when we designed it, we felt that inline mode was a bad practice that implied that the user didn't properly manage his upstream user base and its synchronization with Novu.

In the future, we'll be working internally at SpikeeLabs to develop a synchronization utility between an existing database and Novu on this subject, rather than relying on upsert mode.

The problem can be solved quite simply by upgrading the linked DTO to indicate that the API supports these transmissions too.

@ryshu
Copy link
Collaborator

ryshu commented Jul 7, 2023

image

@unicodeveloper
Copy link
Contributor

@unicodeveloper

The API doesn't support it today, because when we designed it, we felt that inline mode was a bad practice that implied that the user didn't properly manage his upstream user base and its synchronization with Novu.

In the future, we'll be working internally at SpikeeLabs to develop a synchronization utility between an existing database and Novu on this subject, rather than relying on upsert mode.

The problem can be solved quite simply by upgrading the linked DTO to indicate that the API supports these transmissions too.

So can we upgrade the linked DTO to provide this? Every other SDK supports it and we don't want the Python SDK to be an exception.

@kridafans
Copy link

Do you have any updates on this?

@unicodeveloper
Copy link
Contributor

@VeldaKiara Do you want to handle this? It could be your next task. It's pretty straightforward.

@VeldaKiara
Copy link
Contributor

Sure thing. I can pick this up.

@VeldaKiara
Copy link
Contributor

Allow me to understand the issue better. What is needed here is to update the event dto, specifically InputEventDto to reflect this information "to": { "subscriberId": "string", "email": "string", "firstName": "string", "lastName": "string", "phone": "string", "avatar": "string", "locale": "string", "data": {}

@ryshu mentions that "this can be solved quite simply by upgrading the linked DTO to indicate that the API supports these transmissions too" which means if the dto changes the function should also accommodate or reflect this change.

@ethanclusta
Copy link

Hey, just wondering if there's any more update on this functionality being added? Or the synchronisation utility that @ryshu mentions above (which sounds exactly what I was hoping to find)?

@VeldaKiara
Copy link
Contributor

VeldaKiara commented Jan 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

6 participants