Skip to content

Commit

Permalink
fix: fix docs lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Jun 22, 2022
1 parent 60d8504 commit aa1d8ff
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 48 deletions.
22 changes: 22 additions & 0 deletions docs/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"line-length": false,
"no-duplicate-heading": {
"siblings_only": true
},
"no-inline-html": false,
"first-line-heading": false,
"single-title":false,
"commands-show-output": false,
"proper-names": {
"code_blocks": false,
"names": [
"Cake.Markdownlint",
"CommonMark",
"JavaScript",
"Markdown",
"markdown-it",
"markdownlint",
"Node.js"
]
}
}
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation
## Installation

```
```bash
$ yarn
```

### Local Development

```
```bash
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```bash
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```bash
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/docs/channels/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ import TabItem from '@theme/TabItem';
Novu can be used to deliver email message to your customers using a unified delivery API. You can easily integrate your favorite delivery provider using the built-in integration store.

## Configuring email providers

When creating an email provider integration you will be asked to provide additional fields alongside the provider-specific credentials:

- **Sender name** - Will be displayed as the sender of the message
- **From email address** - Emails sent using Novu will be sent using this address

For some email providers including SendGrid you will have to authenticate the **From email address** to make sure you will send email messages using an authorized address.

## Sending Email attachments

You can easily send attachments with the Novu API by passing the attachments array when triggering an Email based notification template.

this article, we’ll go over the benefits of planning for your webinar and top actionable tips to get you moving forward with your webinar marketing strategy.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/channels/sms.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

:::info

This document is still under construction
This document is still under construction

:::
4 changes: 2 additions & 2 deletions docs/docs/community/code-conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)
38 changes: 18 additions & 20 deletions docs/docs/community/create-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,25 @@ export class TwilioSmsProvider implements ISmsProvider {
[GitHub Template](https://github.com/novuhq/provider-template)

## Add provider logos
In order to present the provider in the Integration store we need logos in dark and light mode,
this step is desirable but not necessary you can add and we will check and update if necessary.

In order to present the provider in the Integration store we need logos in dark and light mode,
this step is desirable but not necessary you can add and we will check and update if necessary.
If you locate the logos you can add them to `apps/web/public/static/images/providers` while the name of the file
is the name of the provider.
The possible formats are `svg` and `png`.


## Add config item with in the list

In order to build the UI integration store we need to provide it with list of provider integration.
This part is made up of two parts:

- Create credentials config
- Add provider configuration to providers list
provider configuration to providers list.

### Create credentials config
We need to add the credentials that are needed in order to create integration with the provider. For example, if you
added email provider like SendGrid and the credentials are 'From', 'SenderName' and 'ApiKey' you will need to add

We need to add the credentials that are needed in order to create integration with the provider. For example, if you
added email provider like SendGrid and the credentials are 'From', 'SenderName' and 'ApiKey' you will need to add
a config object in `libs/shared/src/consts/providers/provider-credentials.ts` like below.

```typescript
Expand All @@ -186,12 +188,11 @@ export const sendgridConfig: IConfigCredentials[] = [
];
```


### Add provider to providers list

Now we need to add the provider data to the list located at `libs/shared/src/consts/providers/channels/email.ts`.
Note that the id is the provider's name, displayName is the provider's name in pascal case, credentials are the one
you created on the previous step, logoFileName should be as it was on the adding logo step
(with the format type included).
Note that the id is the provider's name, displayName is the provider's name in pascal case, credentials are the one
you created on the previous step, logoFileName should be as it was on the adding logo step (with the format type included).

```typescript
{
Expand All @@ -204,21 +205,19 @@ you created on the previous step, logoFileName should be as it was on the adding
}
```


## Add provider handler in the API

### Adding the provider depepndecy to the API
In the previous step, you created a standalone provider package that will be published to NPM, however currently in
your development environment it is not yet published. In order to use it locally please go to the `package.json`
located in `apps/api/package.json` and add it manually to the dependencies list:
`"@novu/<NEW_PROVIDER_NAME>": "^<VERSION>"`
### Adding the provider dependency to the API

In the previous step, you created a standalone provider package that will be published to NPM,
however currently in your development environment it is not yet published. In order to use it locally please go to the `package.json` located in `apps/api/package.json` and add it manually to the dependencies list: `"@novu/<NEW_PROVIDER_NAME>": "^<VERSION>"`

Please note that the provider name and version can be found from the provider `package.json` you created earlier.
After adding the dependency run `npm run setup:project` from the root of the monorepo. so, it can create the required symlinks for the newly created package.

### Create provider handler
In order to map internally the different providers credentials, we need to add a provider handler that located in
`apps/api/src/app/events/services/mail-service/handlers`.

In order to map internally the different providers credentials, we need to add a provider handler that located in `apps/api/src/app/events/services/mail-service/handlers`.

Example of SendGrid handler

Expand All @@ -241,6 +240,5 @@ export class SendgridHandler extends BaseHandler {
```

### Add handler to factory
The last step is to initialize the handler in the factory located in
`apps/api/src/app/events/services/mail-service/mail.factory.ts`

The last step is to initialize the handler in the factory located in `apps/api/src/app/events/services/mail-service/mail.factory.ts`
3 changes: 1 addition & 2 deletions docs/docs/notification-center/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Novu provides you a set of API's and components to create rich customized notifi

After creating your Novu Platform account and creating your first notification template it's time to connect the In-app channel to your application.

```
```bash
npm install @novu/notification-center
```

Expand All @@ -37,5 +37,4 @@ function Header() {

That's it! Now you're ready to send your first notifications using Novu.


Not using React? Checkout the [iFrame Embed docs](/docs/notification-center/iframe-embed)
2 changes: 1 addition & 1 deletion docs/docs/notification-center/react-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Novu provides the `@novu/notification-center` a react library that helps to add a fully functioning notification center to your web application in minutes. Let's do a quick recap on how we can easily use it in your application:

```
```bash
npm install @novu/notification-center
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/overview/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ OCL was built all around the idea of separation of concerns (SoC). The idea is t
Let's deep dive into the building blocks of Novu's OCL approach.

## The mental model
![Application Diagram - Frame 1](https://user-images.githubusercontent.com/8872447/168135722-2643eac4-8fcd-4de6-909b-02118faa1dc8.jpeg)

![Application Diagram - Frame 1](https://user-images.githubusercontent.com/8872447/168135722-2643eac4-8fcd-4de6-909b-02118faa1dc8.jpeg)

## Templates

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/overview/docker-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You need the following installed in your system:

Clone the Novu repo and enter the docker directory locally:

```
```bash
# Get the code
git clone --depth 1 https://github.com/novuhq/novu

Expand Down
12 changes: 9 additions & 3 deletions docs/docs/overview/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sidebar_position: 2
# Quick Start

To create your free managed or docker based Novu environment use our CLI tool:

```shell
npx novu init
```
Expand Down Expand Up @@ -41,7 +42,6 @@ You can specify the content for email in two ways:

**Visual template builder** - For simple usecases you can use our visual template editor with limited control over design but easier to get-started.


**Custom Code** - You can use the custom code section to specify custom html that will be used for the email.

You can specify custom variables using the [{{handlebars}}](https://handlebarsjs.com/guide/) syntax.
Expand Down Expand Up @@ -73,13 +73,17 @@ await novu.trigger('<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL>',
}
);
```

The trigger function contains a parameters object as the second parameter. Let's explore it's different options:

### `to` key

The `to` parameter contains the information about the subscriber of the notification, you can work with Novu in 2 modes:

#### Pass the subscriber information in trigger (Quickest)

You can pass the subscriber object containing the following keys as this paramter:

```typescript
await novu.trigger('<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL>',
{
Expand All @@ -103,15 +107,17 @@ Novu will create an upsert command and either create a subscriber with specified

**Note:** The api will perform a PATCH command, updating only the fields passed to it. So in order to reset a specific field you must explicitly pass `null` as the fields param.


#### Pass only the subscriberId (Recommended)

```typescript
{
to: 'SUBSCRIBER_ID',
payload: {}
}
```

In this approach, you will only pass the subscriberId as part of the trigger, however it will require you to identify the subscriber using the `identify` method from the `@novu/node` library.

### `payload` object
Can pass any serializible JSON object to be used in the notification templates.

Can pass any serializible JSON object to be used in the notification templates.
4 changes: 2 additions & 2 deletions docs/docs/platform/activity-feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Novu provides a notification activity feed that monitors every outgoing message associated with its relevant metadata.
This can be used to monitor activity and discover potential issues with a specific provider or a channel type.

![](/img/activity.png)
[Activity Screen](/img/activity.png)

## Viewing a specific subscriber activity

To use a subscriber activity feed you can filter the feed by using the subscriberId or email. This will show only the relevant data for this particular subscriber.
To use a subscriber activity feed you can filter the feed by using the subscriberId or email. This will show only the relevant data for this particular subscriber.

You can hover over the status icon to get additional information in case there was an error during delivery.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/platform/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Novu runs all your requests in the context of an environment. By default, we will create 2 environments when your account was just created: Development, and production.

#### Development environment
## Development environment

Used for testing purposes and validating notification changes prior to committing them to the production environment.

#### Production
## Production

Will be your live/production environment, you cannot make changes to this environment templates directly. You will first have to make the changes in Development mode and then promote the to Production.

Expand Down
8 changes: 7 additions & 1 deletion docs/docs/platform/subscribers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
---

# Subscribers

Novu manages your users in a specific subscribers data model, that allows the Novu API to manage different aspects of the notification flow while providing an easy interface for triggering notifications.

A novu subscribers contains the following data points:
Expand All @@ -10,6 +11,7 @@ A novu subscribers contains the following data points:
- **Contact information** - Things like e-mail, phone number, push tokens and etc... They will be used when a multi-channel template will be configured. Managing all communication credentials will reduce the amount of data you need to pass when triggering a notification.

## Creating a subscriber

When you want to send a notification to a specific recipient in the Novu platform, you must first create a subscriber using our server SDK.

```typescript
Expand All @@ -27,11 +29,14 @@ await novu.subscribers.identify(user.id, {
```

Novu will create a subscriber if one does not exist, and will update existing subscribers based on the identify payload. You can call this function during registration or signup to make sure the subscriber data is up to date.

### Subscriber identifier
This is a unique identifier used by Novu to keep track of a specific subscriber. We recommend using the internal id you application uses for a specific users.

This is a unique identifier used by Novu to keep track of a specific subscriber. We recommend using the internal id you application uses for a specific users.
Using an identifier like email might cause issues locating a specific subscriber once they change their email address.

### Updating subscriber data

In some cases you want to access subscribers to update a specific field or data attribute. For example when user changes their email address or personal details.

```typescript
Expand All @@ -45,6 +50,7 @@ await novu.subscribers.update(user.id, {
```

### Removing a subscriber

To remove and stop a subscriber from receiving communication, you call the remove API to delete the subscriber.

```typescript
Expand Down
Loading

0 comments on commit aa1d8ff

Please sign in to comment.