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

Outdated documentation #67

Open
cibulka opened this issue Apr 30, 2023 · 0 comments
Open

Outdated documentation #67

cibulka opened this issue Apr 30, 2023 · 0 comments

Comments

@cibulka
Copy link

cibulka commented Apr 30, 2023

Hi,

your README shows only 2 basic examples and for the rest, it refers to developers.sendinblue.com/reference/getting-started-1. This address, however, contains instructions for different library sib-api-v3-sdk with outdated instructions.

Case in point - I've tried to get up and working DOI signup with instructions at this page. I've tried two approaches:

  1. Follow the instructions and just swapped sib-api-v3-sdk with @sendinblue/client. That resulted in Typescript and "undefined" errors.
  2. Tried to intuitively modify the instructions in README of this repo to DOI flow (code below). No TS errors, success message (and correct errors in repeated submissions of the same e-mail address), but no e-mails are sent.

It is hard to know if I do things correctly, or not, as there is no documentation. Are there any plans to update it? Thank you!


Here are my efforts of making the new api work (the code is simplified):

import * as SibApiV3Sdk from '@sendinblue/client';

const apiInstance = new SibApiV3Sdk.ContactsApi();
apiInstance.setApiKey(SibApiV3Sdk.ContactsApiApiKeys.apiKey, process.env.SENDINBLUE_API_KEY!);

const contact = new SibApiV3Sdk.CreateDoiContact();

export async function POST(req: Request) {
  const { email } = await req.json();
  const listId = 2;
  const templateId = 3;
  const redirectionUrl = 'https://example.com';

  contact.email = email;
  contact.includeListIds = [listId];
  contact.templateId = 3;
  contact.redirectionUrl = redirectionUrl;
  
  return apiInstance
    .createContact(contact)
    .catch(console.error);
}

This code adds the user to the list (without any confirmation on their end), returns success message, but does not send any e-mail with confirmation link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant