chore: Move docs to docs repository (#1694)

This commit is contained in:
Pranav Raj S 2021-01-26 16:43:45 +05:30 committed by GitHub
parent ecdeedf914
commit b894b13e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 0 additions and 2701 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

View file

View file

@ -1 +0,0 @@
docs.chatwoot.com

View file

@ -1,79 +0,0 @@
---
path: "/docs/code-of-conduct"
title: "Contributor Covenant Code of Conduct"
---
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at hello@chatwoot.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
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
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View file

@ -1,28 +0,0 @@
---
title: 'Documentation'
path: '/docs'
---
This guide will help you get started with Chatwoot!
### Environment Setup for local development
* [Mac](/docs/installation-guide-mac-os)
* [Ubuntu](/docs/installation-guide-ubuntu)
* [Windows](/docs/installation-guide-windows)
* [Docker](/docs/installation-guide-docker)
### Project Setup
* [Quick Setup](/docs/quick-setup)
* [Environment Variables](/docs/environment-variables)
* [Conversation Continuity with Email](/docs/conversation-continuity)
* [Common Errors](/docs/common-errors)
### Deploying Chatwoot in Production
* [Architecture](/docs/deployment/architecture)
* [Heroku](/docs/deployment/deploy-chatwoot-with-heroku) (recommended)
* [Caprover](/docs/deployment/deploy-chatwoot-with-caprover) (recommended)
* [Docker](/docs/deployment/deploy-chatwoot-with-docker)
* [Linux](/docs/deployment/deploy-chatwoot-in-linux-vm)

View file

@ -1,45 +0,0 @@
---
path: '/docs/channels/api/callback-url'
title: 'Callback URL and message payload'
---
When a new message is created in the API channel, you will get a POST request to the Callback URL specified while creating the API channel. The payload would look like this.
**Event type**: `message_created`
```json
{
"id": 0,
"content": "This is a incoming message from API Channel",
"created_at": "2020-08-30T15:43:04.000Z",
"message_type": "incoming",
"content_type": null,
"content_attributes": {},
"source_id": null,
"sender": {
"id": 0,
"name": "contact-name",
"avatar": "",
"type": "contact"
},
"inbox": {
"id": 0,
"name": "API Channel"
},
"conversation": {
"additional_attributes": null,
"channel": "Channel::Api",
"id": 0,
"inbox_id": 0,
"status": "open",
"agent_last_seen_at": 0,
"contact_last_seen_at": 0,
"timestamp": 0
},
"account": {
"id": 1,
"name": "API testing"
},
"event": "message_created"
}
```

View file

@ -1,34 +0,0 @@
---
path: '/docs/channels/api/configure'
title: 'How to create an API channel inbox?'
---
Setting up an API channel consists of the following steps.
1. Create API Channel inbox
2. Send messages using Chatwoot APIs
3. Receive webhooks on new messages from Chatwoot
This document allows you to create and configure an API channel inbox in Chatwoot installations.
**Step 1**: Go to Settings > Inboxes and click on "Add Inbox".
**Step 2**: Select **API** from the list of channels.
![select-api-inbox](./images/select-api-inbox.png)
**Step 3**: Provide an name for the channel and a callback URL (the events and corresponding payload is defined in the subsequent articles)
![configure-screen](./images/configure-screen.png)
**Step 4**: Add agents to the inbox.
![add-agents](./images/add-agents.png)
**Step 5**: Hooray!! The inbox setup is complete.
![take-me-there](./images/take-me-there.png)
![inbox-welcome-screen](./images/inbox-welcome-screen.png)
Now the channel setup is complete, let us try to send a message using Chatwoot APIs. Read more about it [here](/docs/channels/api/send-messages)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 KiB

View file

@ -1,113 +0,0 @@
---
path: '/docs/channels/api/send-messages'
title: 'Send messages to API channel'
---
To send messages to API channel, you need have a basic understanding of the models and nomenclature used in Chatwoot. Let us try to understand these first.
1. **Channel**: Channel defines the type of the source of conversations. Eg: Facebook, Twitter, API etc.
2. **Inbox**: You can create multiple sources of conversations which is of the same channel type. For eg: You can have more than one Facebook page connected to a Chatwoot account. Each page is called as the inbox in Chatwoot.
3. **Conversation**: A Conversation is a collection of messages.
4. **Contact**: Each conversation has a real life person associated with it, this person is called a contact.
5. **Contact Inboxes**: This is the session for each contact on a inbox. A contact can have multiple sessions and multiple conversations in the same inbox.
### How to send a message in an API Channel?
To send a message in an API channel, you have to create a contact, then create a conversation and then send a message.
APIs require `api_access_token` in the request header. You can get this token by visiting your Profile settings > Access Token
#### 1. Create a contact
API documentation: (https://www.chatwoot.com/developers/api/#operation/contactCreate)
Pass the inbox id of the API channel along with other params specified. This would create a session for you automatically. A sample response would look like the one below.
```json
{
"email": "string",
"name": "string",
"phone_number": "string",
"thumbnail": "string",
"additional_attributes": {},
"contact_inboxes": [
{
"source_id": "string",
"inbox": {
"id": 0,
"name": "string",
"website_url": "string",
"channel_type": "string",
"avatar_url": "string",
"widget_color": "string",
"website_token": "string",
"enable_auto_assignment": true,
"web_widget_script": "string",
"welcome_title": "string",
"welcome_tagline": "string",
"greeting_enabled": true,
"greeting_message": "string"
}
}
],
"id": 0,
"availability_status": "string"
}
```
As you can see in the payload, you will be able to see the `contact_inboxes` and each `contact_inbox` will have a `source_id`. Source Id can be seen as the session identifier. You will use this source_id to create a new conversation as defined below.
#### 2. Create a conversation
API documentation: (https://www.chatwoot.com/developers/api/#operation/newConversation)
Use the `source_id` received in the previous API call.
You will receive a conversation id which can be used to create a message.
```json
{
"id": 0
}
```
#### 3. Create a new message
API documentation: (https://www.chatwoot.com/developers/api/#operation/conversationNewMessage)
There are 2 types of messages.
1. **Incoming**: Messages sent by the end user is classified as an incoming message.
2. **Outgoing**: Messages sent by the agent is classified as an outgoing message.
If you call the API with the correct content, you will receive a payload similar to the one below.
```json
{
"id": 0,
"content": "This is a incoming message from API Channel",
"inbox_id": 0,
"conversation_id": 0,
"message_type": 0,
"content_type": null,
"content_attributes": {},
"created_at": 0,
"private": false,
"sender": {
"id": 0,
"name": "Pranav",
"type": "contact"
}
}
```
If everything is sucessful you will see the conversation on the dashboard as follows.
![conversation](./images/conversation.png)
You will be notified when a new message is created on the URL specified while creating the API channel. You can read about the message payload [here](/docs/channels/api/callback-url)

View file

@ -1,40 +0,0 @@
---
path: '/docs/channels/facebook'
title: 'How to create Facebook channel?'
---
If you are using a self-hosted Chatwoot installation, please configure the Facebook app as described in the [guide to setup Facebook app](/docs/facebook-setup)
**Step 1**. Click on "Add Inbox" button from Settings > Inboxes page.
![fb_create](./images/facebook/inbox_create.png)
**Step 2**. Click on "Facebook" icon.
![list_of_channels](./images/facebook/list_of_channels.png)
**Step 3**. Click on Facebook login button. It will open a new window for you to login.
![create_fb](./images/facebook/login_with_facebook.png)
**Step 4**. Authenticate with Facebook and select the page you want to connect. Enable all permissions shown in the list, otherwise the app might not work.
![link_account](./images/facebook/link_account.png)
![list_of_pages](./images/facebook/list_of_pages.png)
![list_of_pages](./images/facebook/permissions.png)
![select_page](./images/facebook/select_page.png)
**Step 5**. "Add agents" to your Facebook inbox.
![add_agents](./images/add_agents.png)
**Step 6**. Hooray! You have successfully created a Facebook inbox. Whenever a customer sends a message to your Facebook page, you will be able to see it here and manage it.
![finish_inbox](./images/facebook/finish_inbox.png)
**Step 7**. If you want to update the agents who have access to the inbox, you can go to Settings > Inboxes.
![inbox_settings](./images/facebook/inbox_settings.png)

View file

@ -1,84 +0,0 @@
---
path: '/docs/website-sdk/identity-validation'
title: 'Identity validation in Chatwoot'
---
To make sure the conversations between the customers and the support agents are private and to disallow impersonation, you can setup identity validation Chatwoot.
Identity validation can be enabled by generating an HMAC. The key used to generate HMAC for each webwidget is different and can be copied from Inboxes -> Settings -> Configuration -> Identity Validation -> Copy the token shown there
You can generate HMAC in different languages as shown below.
```php
<?php
$key = 'webwidget.hmac_token';
$message = 'identifier';
$identifier_hash = hash_hmac('sha256', $message, $key);
?>
```
```js
const crypto = require('crypto');
const key = 'webwidget.hmac_token';
const message = 'identifier';
const hash = crypto.createHmac('sha256', key).update(message);
hash.digest('hex');
```
```rb
require 'openssl'
require 'base64'
key = 'webwidget.hmac_token'
message = 'identifier'
OpenSSL::HMAC.hexdigest('sha256', key, message)
```
```elixir
key = 'webwidget.hmac_token'
message = 'identifier'
signature = :crypto.hmac(:sha256, key, message)
Base.encode16(signature, case: :lower)
```
```go
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
)
func main() {
secret := []byte("webwidget.hmac_token")
message := []byte("identifier")
hash := hmac.New(sha256.New, secret)
hash.Write(message)
hex.EncodeToString(hash.Sum(nil))
}
```
```py
import hashlib
import hmac
import base64
message = bytes('webwidget.hmac_token', 'utf-8')
secret = bytes('identifier', 'utf-8')
hash = hmac.new(secret, message, hashlib.sha256)
hash.hexdigest()
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 873 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 KiB

View file

@ -1,65 +0,0 @@
---
path: "/docs/channels/feature-comparison"
title: "Supported features on channels"
---
### Supported message type
<div class="table table-striped">
| Channel | Incoming/Outgoing message | Activity message | Template message |
| -- | -- | -- | -- |
| Website | Yes | Yes | Yes |
| Facebook | Yes | Yes | No |
| Twitter DM | Yes | Yes | No |
| Tweets | Yes | Yes | No |
| SMS | Yes | Yes | No |
| Whatsapp | Yes | Yes | No |
</div>
### Maximum message size (number of characters)
<div class="table table-striped">
| Channel | Maximum message size |
| -- | -- |
| Website | 10,000 |
| Facebook | 640 |
| Twitter DM | 10,000 |
| Tweets | 280 |
| SMS | 160 |
| Whatsapp | 10,000 |
</div>
### Outgoing message restriction
<div class="table table-striped">
| Channel | Restriction |
| -- | -- |
| Website | No restriction |
| Facebook | Cannot send promotional messages 24 hours after the last incoming message |
| Twitter DM | No restriction |
| Tweets | No restriction |
| SMS | No restriction |
| Whatsapp | Cannot send any message other than Whatsapp approved template messages 24 hours after the last incoming message |
</div>
### Available features
<div class="table table-striped">
| Channel | Channel greeting | Attachments | Agent Auto assignment | Slack |
| -- | -- | -- | -- | -- |
| Website | Yes | Yes | Yes | Yes |
| Facebook | Yes | Yes | Yes | No |
| Twitter DM | Yes | No | Yes | No |
| Tweets | Yes | No | Yes | No |
| SMS | Yes | No | Yes | No |
| Whatsapp | Yes | Yes | Yes | No |
</div>

View file

@ -1,32 +0,0 @@
---
path: '/docs/channels/twitter'
title: 'How to create Twitter channel?'
---
**Step 1**. Click on "Add Inbox" button from Settings > Inboxes page.
![inbox_create](./images/twitter/inbox_create.png)
**Step 2**. Click on "Twitter" icon.
![list_of_channels](./images/twitter/list_of_channels.png)
**Step 3**. Click on "Sign in with Twitter" button.
![sign_in_with_twitter](./images/twitter/sign_in_with_twitter.png)
**Step 4**. You will be redirected to Twitter. Click on "Authorize app" button.
![authorize_twitter](./images/twitter/authorize_twitter.png)
**Step 5**. "Add agents" to your website inbox.
![add_agents](./images/add_agents.png)
**Step 6**. Hooray! You have successfully created a Twitter inbox. You will be able to manage Twitter DMs and tweets mentioning you in the Chatwoot Inbox.
![finish_inbox](./images/twitter/finish_inbox.png)
**Step 7**. If you want to update the agents who have access to the inbox, you can go to Settings > Inboxes.
![inbox_settings](./images/twitter/inbox_settings.png)

View file

@ -1,28 +0,0 @@
---
path: '/docs/channels/website'
title: 'How to create website channel?'
---
**Step 1**. Click on "Add Inbox" button from Settings > Inboxes page.
![inbox_create](./images/inbox_create.png)
**Step 2**. Click on "Website" icon.
![list_of_channels](./images/list_of_channels.png)
**Step 3**. Provide your website name and url. Website name will be shown on the live chat widget.
![create_website](./images/create_website.png)
**Step 4**. "Add agents" to your website inbox.
![add_agents](./images/add_agents.png)
**Step 5**. Hooray! You have successfully created a website inbox. Copy and paste the code shown in the page to your website and start supporting your customers.
![finish_inbox](./images/finish_inbox.png)
**Step 6**. If you want to update the agents who have access to the inbox, you can go to Settings > Inboxes. You will be able to see your website inbox listed there. Click on Settings. You will be able to see the code as well as the list of agents who have access to the inbox.
![inbox_settings](./images/inbox_settings.png)

View file

@ -1,142 +0,0 @@
---
path: '/docs/website-sdk'
title: 'Sending Information into Chatwoot'
---
Additional information about a contact is always useful. The Chatwoot Website SDK ensures that you can send additional information that you have about the user.
If you have installed our code on your website, the SDK would expose `window.$chatwoot` object.
In order to make sure that the SDK has been loaded completely, please make sure that you listen to `chatwoot:ready` event as follows:
```js
window.addEventListener('chatwoot:ready', function () {
// Use window.$chatwoot here
// ...
});
```
To hide the bubble, you can use the setting mentioned below. **Note**: If you use this, then you have to trigger the widget by yourself.
```js
window.chatwootSettings = {
hideMessageBubble: false,
position: 'left', // This can be left or right
locale: 'en', // Language to be set
type: 'standard', // [standard, expanded_bubble]
};
```
Chatwoot support 2 designs for for the widget
1. Standard (default)
![Standard-bubble](./images/sdk/standard-bubble.gif)
2. Expanded bubble
![Expanded-bubble](./images/sdk/expanded-bubble.gif)
If you are using expanded bubble, you can customize the text used in the bubble by setting `launcherTitle` parameter on chatwootSettings as described below.
```js
window.chatwootSettings = {
type: 'expanded_bubble',
launcherTitle: 'Chat with us'
}
```
### To enable popout window
Inorder to enable the popout window, add the following configuration to `chatwootSettings`. This option is disabled by default.
```js
window.chatwootSettings = {
// ...Other Config
showPopoutButton: true,
}
```
### To trigger widget without displaying bubble
```js
window.$chatwoot.toggle();
```
### To set the user in the widget
```js
window.$chatwoot.setUser('<unique-identifier-key-of-the-user>', {
email: '<email-address-of-the-user@your-domain.com>',
name: '<name-of-the-user>',
avatar_url: '<avatar-url-of-the-user>',
});
```
`setUser` accepts an identifier which can be a `user_id` in your database or any unique parameter which represents a user. You can pass email, name, avatar_url as params. Support for additional parameters is in progress.
Make sure that you reset the session when the user logs out of your app.
### Identity validation
To disallow impersonation and to keep the conversation with your customers private, we recommend setting up the identity validation in Chatwoot. Identity validation is enabled by generating an HMAC(hash based message authentication code) based on the `identifier` attribute, using SHA256. Along with the `identifier` you can pass `identifier_hash` also as shown below to make sure that the user is correct one.
```js
window.$chatwoot.setUser(`<unique-identifier-key-of-the-user>`, {
name: '', // Name of the user
avatar_url: '', // Avatar URL
email: '', // Email of the user
identifier_hash: '' // Identifier Hash generated based on the webwidget hmac_token
})
```
To generate HMAC, read [identity validation](/website-sdk/identity-validation)
### Set custom attributes
Inorder to set additional information about the customer you can use customer attributes field.
To set a custom attributes call `setCustomAttributes` as follows
```js
window.$chatwoot.setCustomAttributes({
accountId: 1,
pricingPlan: 'paid',
// You can pass any key value pair here.
// Value should either be a string or a number.
// You need to flatten nested JSON structure while using this function
});
```
You can view these information in the sidepanel of a conversation.
To delete a custom attribute, use `deleteCustomAttribute` as follows
```js
window.$chatwoot.deleteCustomAttribute('attribute-name');
```
### To set language manually
```js
window.$chatwoot.setLocale('en');
```
To set the language manually, use the `setLocale` function.
### To set labels on the conversation
Please note that the labels will be set on a conversation if the user has not started a conversation. In that case, the following items will not have any effect:
```js
window.$chatwoot.setLabel('support-ticket');
window.$chatwoot.removeLabel('support-ticket');
```
### To refresh the session (use this while you logout the user from your app)
```js
window.$chatwoot.reset();
```

View file

@ -1,54 +0,0 @@
---
path: '/docs/channels/whatsapp-sms-twilio'
title: 'How to create a Whatsapp/SMS channel with Twilio?'
---
**Step 1**. Click on "Add Inbox" button from Settings > Inboxes page.
![sms_create](./images/twilio/inbox_create.png)
**Step 2**. Click on "Twilio" icon.
![list_of_channels](./images/twilio/list_of_channels.png)
**Step 3**. Configure the inbox.
These are the inputs required to create this channel:
<div class="table table-striped">
| Input | Description | Where can I find it |
| ------------ | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Channel Name | This is the name inbox, this will be used across the application. | N/A |
| Channel Type | Select SMS, if you are integrating an SMS channel. Select Whatsapp, if you have a verified Whatsapp number in Twilio. | N/A |
| Phone Number | This is the number you will be using to communicate with your customer. This has to be verified in Twilio. | Enter your number as in the Twilio Dashboard |
| Account SID | Account SID in Twilio Console | Login to Twilio Console. Here, you would be able to see the Account SID and the Auth Token |
| Auth Token | Auth token for the account | Login to the Twilio Console. Here, you would be able to see the Account SID and the Auth Token |
</div>
![create_twilio](./images/twilio/create_twilio_inbox.png)
**Step 4**. "Add agents" to your inbox.
![add_agents](./images/add_agents.png)
**Step 6**. Hooray! You have successfully created a whatsapp/sms inbox.
![finish_inbox](./images/twilio/finish_inbox.png)
If it is an SMS Channel, then you don't need to do anything else. You will start receiving the messages in the dashboard whenever a customer sends you one.
If you are connecting a **Whatsapp** channel, you have to configure a callback URL in the Twilio inbox:
- Login to your Twilio Console.
- Go to `Programmable SMS > Whatsapp > Senders`.
- You will be able to see your phone number. Click on it, it will display a field like the one shown below.
![twilio_console](./images/twilio/twilio_console.png)
- Provide `https://app.chatwoot.com/twilio/callback` as the value for `WHEN A MESSAGE COMES IN` input.
**Step 7**. If you want to update the agents who have access to the inbox, you can go to Settings > Inboxes.
![inbox_settings](./images/twilio/inbox_settings.png)

View file

@ -1,44 +0,0 @@
---
path: "/docs/contributing-guide"
title: "Contributing Guide"
---
Thank you for taking an interest in contributing to Chatwoot. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
- [Code of Conduct](https://www.chatwoot.com/docs/code-of-conduct)
- [Development Setup](https://www.chatwoot.com/docs/installation-guide-ubuntu)
- [Environment Setup](https://www.chatwoot.com/docs/quick-setup)
## Pull Request Guidelines
### General Guidelines
- We use [git-flow](https://nvie.com/posts/a-successful-git-branching-model/) branching model. The base branch is `develop`
- Please raise your PRs against `develop` branch
- It's okay and encouraged to have multiple small commits as you work on the PR - we will squash the commits before merging.
### Getting Started
- Before starting your work, ensure an [issue](https://github.com/chatwoot/chatwoot/issues) exist for it. If not feel free to create one.
- Add a comment on the issue and wait for the issue to be assigned before you start working on it.
- This helps to avoid multiple people working on similar issues.
- If the solution is complex, propose the solution on the issue and wait for one of the core contributors to approve before going into the implementation.
- This helps in shorter turn around times in merging PRs
- For new feature requests, Provide a convincing reason to add this feature. Real-life business use-cases will be super helpful.
- Feel free to join our [discord community](https://discord.gg/cJXdrwS), if you need further discussions with the core team.
### Developing a new feature:
- Please create the branch in the format `feature/<issue-id>-<issue-name>` (eg: `feature/235-contact-panel`)
- Add accompanying test cases.
### Bug fixes or chores:
- If you are resolving a particular issue, add `Bug: Fix xxxx` (#xxxx is the issue) in your PR title.
- Provide a detailed description of the bug in the PR.
- Add appropriate test coverage if applicable.
### Translations
For language translations, please read the guide [translating Chatwoot to your language](/docs/contributing/translating-chatwoot-to-your-language)

View file

@ -1,34 +0,0 @@
---
path: "/docs/contributing/translating-chatwoot-to-your-language"
title: "Translate Chatwoot to your language"
---
Chatwoot uses American English by default. Each and every string available in Chatwoot can be translated to the language of your choice. Chatwoot uses Crowdin to manage the translation process. The updates from Crowdin is also included along with every release.
### How do I see the strings that needs to be translated?
In the codebase the string are placed in the following locations.
- `app/javascript/dashboard/i18n` - The strings related to the agent dashboard
- `app/javascript/widget/i18n` - The strings related to the web widget
- `config/locales` - The strings used in backend messages or API response.
Alternatively, you can login to the **Crowdin** ([https://translate.chatwoot.com](https://translate.chatwoot.com)) and create an account to view the strings that needs to be translated.
### How to contribute?
If you don't find your language on Crowdin, please create an issue on [Github](https://github.com/chatwoot/chatwoot/issues) to add the language.
#### Translate Strings
The translation process for Chatwoot web and mobile app is managed at [https://translate.chatwoot.com](https://translate.chatwoot.com) using Crowdin. You will have to create an account at Crowdin before you can select a language and contribute.
#### Proofreading
Proofreading helps ensure the accuracy and consistency of translations. Right now, the translations are being accepted without a proof reading step. This would be changed in the future as an when there are more contributors on each language.
*Note:* If you are the only person contributing to a language, make sure that you inform any of the Chatwoot members to gain access to manage the language.
#### Releasing a new language
All the translated strings would be included in the next release. If a language has *60% or more translated strings* in Crowdin, we would enable the language in Chatwoot app during the next release.

View file

@ -1,6 +0,0 @@
---
path: "/docs/contributors"
title: "Contributors"
---
<a href="https://github.com/chatwoot/chatwoot/graphs/contributors"><img src="https://opencollective.com/chatwoot/contributors.svg?width=890&button=false" /></a>

View file

@ -1,66 +0,0 @@
---
path: "/docs/customizations/email-notifications"
title: "Customize email notifications in Chatwoot"
---
Chatwoot allows customization of email notifications in self hosted installations.
To customize the email notifications, follow the instructions below. Inorder to update the content, you have to add a new template in the Database, here is how you can do it.
### 1. Login into the rails console.
For Heroku installation, login to your account, go to the app. Click on "More", select "Run Console" from the dropdown menu. Enter the following command and hit run
```rb
heroku run rails console
```
For Linux VM installations, go to directory where Chatwoot code is available. If you have used the installation script, the default path is `/home/chatwoot/chatwoot`. Run the following command.
```rb
RAILS_ENV=production bundle exec rails console
```
### 2. Create a new template for the emails. Execute the following commands.
```rb
email_template = EmailTemplate.new
email_template.name = 'conversation_assignment' # Accepts conversation_assignment, conversation_creation
email_template.body = '// Enter your content'
email_template.save!
```
#### Variables
Template would receive 3 variable
1. `user` - Use `{{ user.name }}` to get the username.
2. `conversation` - Use `{{ conversation.display_id }}` to get the conversation ID
3. `action_url` - This is the URL of the conversation.
### Default content
Default content of the above template is as shown below
#### 1. Conversation Assignment
```html
<p>Hi {{user.available_name}},</p>
<p>Time to save the world. A new conversation has been assigned to you</p>
<p> Click <a href="{{action_url}}">here</a> to get cracking.</p>
```
#### 2. Conversation Creation
```html
<p>Hi {{user.available_name}}</p>
<p>Time to save the world. A new conversation has been created in {{ inbox.name }}</p>
<p>
Click <a href="{{ action_url }}">here</a> to get cracking.
</p>
```
We use [Liquid templating engine](https://shopify.github.io/liquid/) internally, so all valid operators can be used here.

View file

@ -1,52 +0,0 @@
---
path: "/docs/deployment/cdn/cloudfront"
title: "Configuring Cloudfront with Chatwoot"
---
This document helps you to configure Cloudfront as the asset host for Chatwoot. If you have a high traffic website, we would recommend setting up a CDN for Chatwoot.
### Configure a Cloudfront distribution
**Step 1**: Create a Cloudfront distribution.
![create-distribution](./images/cloudfront/create-distribution.png)
**Step 2**: Select "Web" as delivery method for your content.
![web-delivery-method](./images/cloudfront/web-delivery-method.png)
**Step 3**: Configure the Origin Settings as the following.
![origin-settings](./images/cloudfront/origin-settings.png)
- Provide your Chatwoot Installation URL under Origin Domain Name.
- Select "Origin Protocol Policy" as Match Viewer.
**Step 4**: Configure Cache behaviour.
![cache-behaviour](./images/cloudfront/cache-behaviour.png)
- Configure **Allowed HTTP methods** to use *GET, HEAD, OPTIONS*.
- Configure **Cache and origin request settings** to use *Use legacy cache settings*.
- Select **Whitelist** for *Cache Based on Selected Request Headers*.
- Add the following headers to the **Whitelist Headers**.
![extra-headers](./images/cloudfront/extra-headers.png)
- **Access-Control-Request-Headers**
- **Access-Control-Request-Method**
- **Origin**
**Step 5**: Click on **Create Distribution**. You will be able to see the distribution as shown below. Use the **Domain name** listed in the details as the **ASSET_CDN_HOST** in Chatwoot.
![cdn-distribution-settings](./images/cloudfront/cdn-distribution-settings.png)
### Add ASSET_CDN_HOST in Chatwoot
Your Cloudfront URL will be of the format `<distribution>.cloudfront.net`.
Set
```bash
ASSET_CDN_HOST=<distribution>.cloudfront.net
```
in the environment variables.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 KiB

View file

@ -1,41 +0,0 @@
---
path: "/docs/deployment/architecture"
title: "Chatwoot Production deployment guide"
---
This guide will help you to deploy Chatwoot to production!
### Architecture
Running Chatwoot in production requires the following set of services.
* Chatwoot web servers
* Chatwoot workers
* PostgreSQL Database
* Redis Database
* Email service (SMTP servers / sendgrid / mailgun etc)
* Object Storage ( S3, Azure Storage, GCS, etc)
### Updating your Chatwoot installation
A new version of Chatwoot is released around the first monday of every month. We also release minor versions when there is a need for Hotfixes or security updates.
You can stay tuned to our [Roadmap](https://github.com/chatwoot/chatwoot/milestones) and [releases](https://github.com/chatwoot/chatwoot/releases) on github. We recommend you to stay upto date with our releases to enjoy the lastest features and security updates.
The deployment process for a newer version involves updating your app servers and workers with the latest code. Most updates would involve database migrations as well which can be executed through the following rails command.
```
bundle exec rails db:migrate
```
The detailed instructions can be found in respective deployment guides.
### Available deployment options
If you want to self host Chatwoot, the recommended approach is to use one of the recommended one click installation options from the below list. If you are comfortable with ruby on rails applications, you can also make use of the other deployment options mentioned below.
* [Heroku](/docs/deployment/deploy-chatwoot-with-heroku) (recommended)
* [Caprover](/docs/deployment/deploy-chatwoot-with-caprover) (recommended)
* [Docker](/docs/deployment/deploy-chatwoot-with-docker)
* [Linux](/docs/deployment/deploy-chatwoot-in-linux-vm)

View file

@ -1,57 +0,0 @@
---
path: "/docs/deployment/deploy-chatwoot-with-caprover"
title: "Caprover Chatwoot Production deployment guide"
---
### Caprover Overview
Caprover is an extremely easy to use application server management tool. It is blazing fast and uses Docker under the hood. Chatwoot has been made available as a one-click app in Chatwoot and hence the deployment process is very easy.
### Install Caprover on your VM
Finish your caprover installation by referring to [Getting started guid](https://caprover.com/docs/get-started.html).
### Installing Chatwoot in Caprover
Chatwoot is available in the one-click apps option in caprover, find Chatwoot by searching and clicking on it. Replace the default `version` with the latest `version` of chatwoot. User appropriate values for the Postgres and Redis passwords and click install. It should only take a few minutes.
### Configure the necessary environment variables
Caprover will take care of the installation of Postgres and Redis along with the app and worker servers. We would advise you to replace the database/Redis services with managed/standalone servers once you start scaling.
Also, ensure to set the appropriate environment variables for E-mail, Object Store service etc referring to our [Environment variables guide](./environment-variables)
### Upgrading Chatwoot installation
To update your chatwoot installation to the latest version in caprover, Run the following command in deployment tab for web and worker in the method 5: deploy captain-definition
### web
```json
{
"schemaVersion": 2,
"dockerfileLines": [
"FROM chatwoot/chatwoot:latest",
"RUN chmod +x docker/entrypoints/rails.sh",
"ENTRYPOINT [\"docker/entrypoints/rails.sh\"]",
"CMD bundle exec rake db:setup; bundle exec rake db:migrate; bundle exec rails s -b 0.0.0.0 -p 3000"
]
}
```
### worker
```json
{
"schemaVersion": 2,
"dockerfileLines": [
"FROM chatwoot/chatwoot:latest",
"RUN chmod +x docker/entrypoints/rails.sh",
"ENTRYPOINT [\"docker/entrypoints/rails.sh\"]",
"CMD bundle exec sidekiq -C config/sidekiq.yml"
]
}
```
### Further references
- https://isotropic.co/how-to-install-chatwoot-to-a-digitalocean-droplet/

View file

@ -1,32 +0,0 @@
---
path: "/docs/deployment/deploy-chatwoot-with-docker"
title: "Docker Chatwoot Production deployment guide"
---
### Deploying with docker
We publish our base images to docker hub. Build your web/worker images from these base images
### Web
```
FROM chatwoot/chatwoot:latest
RUN chmod +x docker/entrypoints/rails.sh
ENTRYPOINT ["docker/entrypoints/rails.sh"]
CMD bundle exec bundle exec rails s -b 0.0.0.0 -p 3000
```
### worker
```
FROM chatwoot/chatwoot:latest
RUN chmod +x docker/entrypoints/rails.sh
ENTRYPOINT ["docker/entrypoints/rails.sh"]
CMD bundle exec sidekiq -C config/sidekiq.yml
```
The app servers will available on port `3000`. Ensure the images are connected to the same database and Redis servers. Provide the configuration for these services via environment variables.
### Upgrading
Update the images using the latest image from chatwoot. Run the `rails db:migrate` option after accessing console from one of the containers running latest image.

View file

@ -1,28 +0,0 @@
---
path: "/docs/deployment/deploy-chatwoot-with-heroku"
title: "Heroku Chatwoot Production deployment guide"
---
### Deploying on Heroku
Deploy chatwoot on Heroku through the following steps
1. Click on the [one click deploy button](https://heroku.com/deploy?template=https://github.com/chatwoot/chatwoot/tree/master) and deploy your app.
2. Go to the Resources tab in the Heroku app dashboard and ensure the worker dynos is turned on.
3. Head over to settings tabs in Heroku app dashboard and click reveal config vars.
4. Configure the environment variables for [mailer](https://www.chatwoot.com/docs/environment-variables#configure-emails) and [storage](https://www.chatwoot.com/docs/configuring-cloud-storage) as per the [documentation](https://www.chatwoot.com/docs/environment-variables).
5. Head over to `yourapp.herokuapp.com` and enjoy using Chatwoot.
### Updating the deployment on Heroku
Whenever a new version is out for chatwoot, you update your Heroku deployment through following steps.
1. In the deploy tab, choose `Github` as the deployment option.
2. Connect chatwoot repo to the app.
3. Head over to the manual deploy option, choose `master` branch and hit deploy.
### Known Limitations
1. If you are on a free tier and you dont access the application for a while Heroku will put your dynos to sleep. You can fix this by upgrading the dynos to paid tier.
2. Heroku has an "ephemeral" hard disk. The files uploaded to Chatwoot would not persist after the application is restarted. By default, Chatwoot uses local disk as the upload destination. To overcome this problem, you will have to [configure a cloud storage](https://www.chatwoot.com/docs/configuring-cloud-storage).

View file

@ -1,167 +0,0 @@
---
path: "/docs/deployment/deploy-chatwoot-in-linux-vm"
title: "Production deployment guide for Linux VM"
---
### Deploying to Linux VM
This guide will help you to install **Chatwoot** on **Ubuntu 18.04 LTS / 20.04 LTS / 20.10**. We have prepared a deployment script for you to run. Refer the script and feel free to make changes accordingly to OS if you are on a non-Ubuntu system.
For **Ubuntu 18.04**, use the following script
```bash
https://raw.githubusercontent.com/chatwoot/chatwoot/develop/deployment/setup_18.04.sh
```
For **Ubuntu 20.04** or **Ubuntu 20.10**, use the following script.
```bash
https://raw.githubusercontent.com/chatwoot/chatwoot/develop/deployment/setup_20.04.sh
```
### Steps to install
1. Create a **setup.sh** file and copy the content from the above link or use the following commands.
```bash
wget <link-to-script> -O setup.sh
chmod 755 setup.sh
./setup.sh master
```
2. Execute the script and it will take care of the initial **Chatwoot** setup.
3. **Chatwoot** Installation will now be accessible at `http://{your_ip_address}:3000`
### Configure Nginx and **Let's Encrypt**
1. Configure Nginx to serve as a frontend proxy.
```bash
cd /etc/nginx/sites-enabled
nano yourdomain.com.conf
```
2. Use the following Nginx config after replacing the `yourdomain.com` in `server_name` .
```bash
server {
server_name <yourdomain.com>;
# Point upstream to Chatwoot App Server
set $upstream 127.0.0.1:3000;
# Nginx strips out underscore in headers by default
# Chatwoot relies on underscore in headers for API
# Make sure that the config is turned on.
underscores_in_headers on;
location /.well-known {
alias /var/www/ssl-proof/chatwoot/.well-known;
}
location / {
proxy_pass_header Authorization;
proxy_pass http://$upstream;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on; # Optional
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Connection “”;
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect off;
}
listen 80;
}
```
3. Verify and reload your Nginx config by running following command.
```bash
nginx -t
systemctl reload nginx
```
4. Run **Let's Encrypt** and configure **SSL certificate**.
```bash
mkdir -p /var/www/ssl-proof/chatwoot/.well-known
certbot --webroot -w /var/www/ssl-proof/chatwoot/ -d yourdomain.com -i nginx
```
5. Your Chatwoot installation should be accessible from the `https://yourdomain.com` now.
### Configure the required environment variables
For your Chatwoot installation to properly function you would need to configure some of the essential environment variables like `FRONTEND_URL`, Mailer and a cloud storage config. Refer **[Environment variables](https://www.chatwoot.com/docs/environment-variables)** for the full list.
1. Login as **Chatwoot** and edit the .env file.
```bash
# Login as chatwoot user
sudo -i -u chatwoot
cd chatwoot
nano .env
```
2. Refer **[Environment variables](https://www.chatwoot.com/docs/environment-variables)** and update the required variables. Save the `.env` file.
3. Restart the **Chatwoot** server and enjoy using your self hosted Chatwoot.
```bash
systemctl restart chatwoot.target
```
### Upgrading to newer version of Chatwoot
Whenever a new version of Chatwoot is released, use the following steps to upgrade your instance.
Run the following steps on your VM. Make changes based o your OS if you are on a non-Ubuntu system.
```bash
# Login as Chatwoot user
sudo -i -u chatwoot
# Navigate to the Chatwoot directory
cd chatwoot
# Pull the latest version of the master branch
git checkout master && git pull
# Update dependencies
bundle
yarn
# Recompile the assets
rake assets:precompile RAILS_ENV=production
# Migrate the database schema
RAILS_ENV=production bundle exec rake db:migrate
# Copy the updated targets
cp /home/chatwoot/chatwoot/deployment/chatwoot-web.1.service /etc/systemd/system/chatwoot-web.1.service
cp /home/chatwoot/chatwoot/deployment/chatwoot-worker.1.service /etc/systemd/system/chatwoot-worker.1.service
cp /home/chatwoot/chatwoot/deployment/chatwoot.target /etc/systemd/system/chatwoot.target
# Restart the chatwoot server
systemctl restart chatwoot.target
```
#### If precompile fails
If the asset precompilation step fails with `ActionView::Template::Error (Webpacker can't find application.css in /home/chatwoot/chatwoot/public/packs/manifest.json)` or if you face issues while restarting the server, try the following command and restart the server.
```
RAILS_ENV=production rake assets:clean assets:clobber assets:precompile
```
This command would clear the existing compiled assets and would recompile all the assets. Read more about it [here](https://edgeguides.rubyonrails.org/command_line.html#bin-rails-assets)

View file

@ -1,117 +0,0 @@
---
path: "/docs/installation-guide-docker"
title: "Docker Setup"
---
### Pre-requisites
Before proceeding, make sure you have the latest version of `docker` and `docker-compose` installed.
As of now[at the time of writing this doc], we recommend
```bash
$ docker --version
Docker version 19.03.3, build a872fc2f86
$ docker-compose --version
docker-compose version 1.25.3, build d4d1b42b
```
## Development environment
1. Clone the repository.
```bash
$ git clone https://github.com/chatwoot/chatwoot.git
```
2. Make a copy of the example environment file and modify as required [optional].
```bash
$ cp .env.example .env
```
If you want to set the password for redis when you run docker-compose, set any string value to the environment variable `REDIS_PASSWORD` in the `.env` file.
This will secure the redis running inside docker-compose with the given password.
Also this will be automatically picked up by the app server and sidekiq, to authenticate while making connections to redis server.
3. Build the images.
```bash
$ docker-compose build
```
4. After building the image or after destroying the stack you would have to reset the database using the following command.
```bash
$ docker-compose run --rm rails bundle exec rails db:reset
```
5. To run the app,
```bash
$ docker-compose up
```
* Access the rails app frontend by visiting `http://0.0.0.0:3000/`
* Access Mailhog inbox by visiting `http://0.0.0.0:8025/` (You will receive all emails going out of the application here)
* Access Sidekiq Web UI by visiting `http://0.0.0.0:3000/sidekiq` (You need to login with administrator account to access sidekiq)
#### Login with credentials
```
url: http://localhost:3000
user_name: john@acme.inc
password: 123456
````
6. To stop the app,
```bash
$ docker-compose down
```
### Running rspec tests
For running the complete rspec tests,
```bash
$ docker-compose run --rm rails bundle exec rspec
```
For running specific test,
```bash
$ docker-compose run --rm rails bundle exec rspec spec/<path-to-file>:<line-number>
```
## Production environment
To debug the production build locally, set `SECRET_KEY_BASE` environment variable in your `.env` file and then run the below commands:
```bash
$ docker-compose -f docker-compose.production.yaml build
$ docker-compose -f docker-compose.production.yaml up
```
## Debugging mode
To use debuggers like `byebug` or `binding.pry`, use the following command to bring up the app instead of `docker-compose up`.
```bash
$ docker-compose run --rm --service-port rails
```
## Troubleshooting
If there is an update to any of the following
- `dockerfile`
- `gemfile`
- `package.json`
- schema change
Make sure to rebuild the containers and run `db:reset`.
```bash
$ docker-compose down
$ docker-compose build
$ docker-compose run --rm rails bundle exec rails db:reset
$ docker-compose up
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

View file

@ -1,116 +0,0 @@
---
path: "/docs/installation-guide-mac-os"
title: "Mac OS installation guide"
---
Open terminal app and run the following commands
### Installing the standalone Command Line Tools
Open terminal app and write the code below
```bash
xcode-select --install
```
### Install Homebrew
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
### Install Git
```bash
brew update
brew install git
```
### Install RVM
```bash
curl -L https://get.rvm.io | bash -s stable
```
### Install Ruby
Chatwoot APIs are built on Ruby on Rails, you need install ruby 2.7.2
If you are using `rvm` :
```bash
rvm install ruby-2.7.2
rvm use 2.7.2
source ~/.rvm/scripts/rvm
```
If you are using `rbenv` to manage ruby versions do :
```bash
rbenv install 2.7.2
```
`rbenv` identifies the ruby version from `.ruby-version` file on the root of the project and loads it automatically.
### Install Node.js
Install Node.js from NodeSoure using the following commands
```bash
brew install node
```
### Install yarn
We use `yarn` as package manager
```bash
brew install yarn
```
### Install postgres
The database used in Chatwoot is PostgreSQL.
1) Install PostgresApp (https://postgresapp.com). This is easiest way to get started with PostgreSQL on mac.
or
2) Use the following commands to install postgres.
```bash
brew install postgresql
```
The installation procedure created a user account called postgres that is associated with the default Postgres role. In order to use Postgres, you can log into that account.
```bash
sudo -u postgres psql
```
### Install redis-server
Chatwoot uses Redis server in agent assignments and reporting. To install `redis-server`
```bash
brew install redis
```
Start the redis service.
```bash
brew services start redis
```
### Install imagemagick
Chatwoot uses `imagemagick` library to resize images for showing previews and smaller size based on context.
```bash
brew install imagemagick
```
You can read more on installing imagemagick from source from [here](https://imagemagick.org/script/download.php).
### Install Docker
This is an optional step. Those who are doing development can install docker from [Docker Desktop](https://www.docker.com/products/docker-desktop).

View file

@ -1,108 +0,0 @@
---
path: "/docs/installation-guide-ubuntu"
title: "Ubuntu installation guide"
---
Open a terminal and run the following commands:
```bash
sudo apt-get update
```
### Install Git
```bash
sudo apt-get install git
```
### Install RVM
You need software-properties-common installed in order to add PPA repositories.
```bash
sudo apt-get install software-properties-common
```
```bash
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
```
Enable `Run command as a login shell` in terminal `Preferences`. Restart your computer.
### Install Ruby
Chatwoot APIs are built on Ruby on Rails. You need to install ruby 2.7.2:
```bash
rvm install ruby-2.7.2
```
Use ruby 2.7.2 as default:
```bash
rvm use 2.7.2 --default
```
### Install Node.js
Install Node.js from NodeSource using the following commands:
```bash
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
```
### Install yarn
We use `yarn` as the package manager:
```bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
```
```bash
sudo apt-get update && sudo apt-get install yarn
```
### Install postgres
The database used in Chatwoot is PostgreSQL. Use the following commands to install postgres:
```bash
sudo apt install postgresql postgresql-contrib
```
The installation procedure creates a user account called postgres that is associated with the default Postgres role. In order to use Postgres, you can log into that account:
```bash
sudo -u postgres psql
```
Install `libpg-dev` dependencies for ubuntu:
```bash
sudo apt-get install libpq-dev
```
### Install redis-server
Chatwoot uses Redis server in agent assignments and reporting. You need to install `redis-server`:
```bash
sudo apt-get install redis-server
```
Next, enable Redis to start on system boot:
```bash
sudo systemctl enable redis-server.service
```
### Install imagemagick
```bash
sudo apt-get install imagemagick
```

View file

@ -1,102 +0,0 @@
---
path: '/docs/installation-guide-windows'
title: 'Windows 10 Installation Guide'
---
### Requirements
You need to install the Linux Subsystem for Windows.
1. The first step is to enable "Developer mode" in Windows. You can do this by opening up Settings and navigating to "Update & Security". In there, choose the tab on the left that reads "For Developers". Turn the "Developer mode" toggle on to enable it.
<img src="./img/developer-mode.jpg" width="500" alt="Enable Developer Mode" style="display: block; margin-left: auto; margin-right: auto;">
2. Next you have to enable the Windows Subsystem for Linux. Open the "Control Panel" and go to "Programs and Features". Click on the link on the left "Turn Windows features on or off". Look for the "Windows Subsystem for Linux" option and select the checkbox next to it.
<img src="./img/enable-wsl.jpg" width="500" alt="Enable WSL" style="display: block; margin-left: auto; margin-right: auto;">
3. Once that's complete, you can open up the Start Menu again and search for "Bash". This time it will have the Ubuntu logo.
### Installing RVM & Ruby
You need core linux dependencies installed in order to install ruby.
```bash
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
```
Install RVM & ruby version 2.7.2
```bash
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.7.2
rvm use 2.7.2 --default
ruby -v
```
### Install Node.js
Install `Node.js` from NodeSource using the following commands
```bash
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
```
### Install yarn
We use `yarn` as the package manager
```bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
```
```bash
sudo apt-get update && sudo apt-get install yarn
```
### Install postgres
The database used in Chatwoot is PostgreSQL. Use the following commands to install postgres:
```bash
sudo apt install postgresql postgresql-contrib
```
The installation procedure created a user account called postgres that is associated with the default Postgres role. In order to use Postgres, you can log into that account.
```bash
sudo -u postgres psql
```
Install `libpg-dev` dependencies for Ubuntu
```bash
sudo apt-get install libpq-dev
sudo service postgresql start
```
### Install redis-server
Chatwoot uses Redis server in agent assignments and reporting. To install `redis-server`
```bash
sudo apt-get install redis-server
```
Enable Redis to start on system boot.
```bash
sudo systemctl enable redis-server.service
```
### Install imagemagick
```bash
sudo apt-get install imagemagick
```

View file

@ -1,74 +0,0 @@
---
path: "/docs/configuring-cloud-storage"
title: "Configuring Cloud Storage"
---
### Using Amazon S3
You can get started with [Creating an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html) and [Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) to configure the following details.
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE='amazon'
S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
```
### Using Google GCS
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE='google'
GCS_PROJECT=
GCS_CREDENTIALS=
GCS_BUCKET=
```
the value of the `GCS_CREDENTIALS` should be a json formatted string containing the following keys
```bash
{
"type": "service_account",
"project_id" : "",
"private_key_id" : "",
"private_key" : "",
"client_email" : "",
"client_id" : "",
"auth_uri" : "",
"token_uri" : "",
"auth_provider_x509_cert_url" : "",
"client_x509_cert_url" : ""
}
```
### Using Microsoft Azure
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE='microsoft'
AZURE_STORAGE_ACCOUNT_NAME=
AZURE_STORAGE_ACCESS_KEY=
AZURE_STORAGE_CONTAINER=
```
### Using Amazon S3 Compatible Service
Use s3 compatible service such as [DigitalOcean Spaces](https://www.digitalocean.com/docs/spaces/resources/s3-sdk-examples/#configure-a-client), Minio.
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE='s3_compatible'
STORAGE_BUCKET_NAME=
STORAGE_ACCESS_KEY_ID=
STORAGE_SECRET_ACCESS_KEY=
STORAGE_REGION=nyc3
STORAGE_ENDPOINT=https://nyc3.digitaloceanspaces.com
```

View file

@ -1,82 +0,0 @@
---
path: "/docs/conversation-continuity"
title: "Configuring Conversation Continuity with Email"
---
### Conversation continuity
Conversation continuity is a de-facto most expected feature for all kind of support platforms. When we support multiple channels and integrations it becomes really difficult to implement this from the start. As for Chatwoot, with Facebook or Twitter channels, the users usually expect you to reach back on the same platform itself.
When it comes to the Web Widget which is embedded in a website, this is not the case. There are technical limitations for us to maintain this conversation continuity. When an end-user initiates the chat from the Web Widget and an agent is not online, there are questions on how you reach back to that user and how a conversation can progress.
As a first step what we did for this was to capture the email of the user when the chat is initiated. The chat window prompts the user for an email when the user starts a conversation. This is captured in the system as part of the contact's information. The agent can reach back to the user using this given email, but until now the replies used to come back to the agent's email address directly and not Chatwoot.
With a second step that we have done, we are now introducing the capability of conversation continuity directly in Chatwoot Inbox. How this works is, once you have configured all the email settings (which will be discussed shortly in the upcoming sections below), you can send a reply as an email to any of the conversations with a contact having an email and receive the email reply in the conversation thread. This is irrespective of the channel from where the conversation was first initiated. It can be Facebook, Twitter, Web Widget, Twilio, Whatsapp and what not. You conversation always continues seamlessly.
### Configuring inbound reply emails
There are a couple of email infrastructure service providers to handle the incoming emails that we support at the moment. They are
Sendgrid, Mandrill, Mailgun, Exim, Postfix, Qmail and Postmark.
Step 1 : We have to set the inbound email service used as an environment variable.
```bash
# Set this to appropriate ingress service for which the options are :
# "relay" for Exim, Postfix, Qmail
# "mailgun" for Mailgun
# "mandrill" for Mandrill
# "postmark" for Postmark
# "sendgrid" for Sendgrid
RAILS_INBOUND_EMAIL_SERVICE=relay
```
This configures the ingress service for the app. Now we have to set the password for the ingress service that we use.
```bash
# Use one of the following based on the email ingress service
# Set this if you are using Sendgrid, Exim, Postfix, Qmail or Postmark
RAILS_INBOUND_EMAIL_PASSWORD=
# Set this if you are Mailgun
MAILGUN_INGRESS_SIGNING_KEY=
# Set this if you are Mandrill
MANDRILL_INGRESS_API_KEY=
```
If you are using Mailgun as your email service, in the Mailgun dashboard configure it to forward your inbound emails to `https://example.com/rails/action_mailbox/mailgun/inbound_emails/mime` if `example.com` is where you have hosted the application.
If you are choosing Sendgrid to be your email service, configure SendGrid Inbound Parse to forward inbound emails to forward your inbound emails to `/rails/action_mailbox/sendgrid/inbound_emails` with the username `actionmailbox` and the password you previously generated. If the deployed application was hosted at `example.com`, you can configure the following URL as the forward route.
```bash
https://actionmailbox:PASSWORD@example.com/rails/action_mailbox/sendgrid/inbound_emails
```
If you are configuring Mandrill as your email service, configure Mandrill to route your inbound emails to `https://example.com/rails/action_mailbox/mandrill/inbound_emails` if `example.com` is where you have hosted the application.
If you want to know more about configuring other services visit [Action Mailbox Basics](https://edgeguides.rubyonrails.org/action_mailbox_basics.html#configuration)
### Enable continuity in the account.
1. Enable `inbound_emails` (Login to rails console and execute the following)
```
account = Account.find(1)
account.enabled_features // This would list enabled features.
account.enable_features('inbound_emails')
account.save!
```
2. Set an inbound domain. This is the domain with which you have set up above.
```
account = Account.find(1)
account.domain='domain.com'
account.save!
```
After executing these steps, the mail sent from Chatwoot will have a `replyto:` in the following format `reply+<random-hex>@<your-domain.com>` and reply to those would get appended to your conversation.

View file

@ -1,191 +0,0 @@
---
path: "/docs/environment-variables"
title: "Environment Variables"
---
### Database configuration
You can set Postgres connection URI as `DATABASE_URL` in the environment to connect to the database.
The URI is of the format
```bash
postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]
```
Alternatively, use the following values in database.yml which lives inside `config` directory.
```bash
development:
<<: *default
username: postgres
password:
database: chatwoot_dev
```
We use `dotenv-rails` gem to manage the environment variables. There is a file called `env.example` in the root directory of this project with all the environment variables set to empty value. You can set the correct values as per the following options. Once you set the values, you should rename the file to `.env` before you start the server.
### Configure FB Channel
To use FB Channel, you have to create an Facebook app in developer portal. You can find more details about creating FB channels [here](https://developers.facebook.com/docs/apps/#register)
```bash
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
```
### Configure emails
For development, you don't need an email provider. Chatwoot uses [letter-opener](https://github.com/ryanb/letter_opener) gem to test emails locally
For production use, use the following variables to set SMTP server.
```bash
MAILER_SENDER_EMAIL=
SMTP_ADDRESS=
SMTP_USERNAME=
SMTP_PASSWORD=
```
If you would like to use Sendgrid to send your emails, use the following environment variables:
```bash
SMTP_ADDRESS=smtp.sendgrid.net
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<your verified domain>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=apikey
SMTP_PASSWORD=<your Sendgrid API key>
```
If you would like to use Mailgun to send your emails, use the following environment variables:
```bash
SMTP_ADDRESS=smtp.mailgun.org
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<Your domain, this has to be verified in Mailgun>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=<Your SMTP username, view under Domains tab>
SMTP_PASSWORD=<Your SMTP password, view under Domains tab>
```
If you would like to use Mailchimp to send your emails, use the following environment variables:
Note: Mandrill is the transactional email service for Mailchimp. You need to enable transactional email and login to mandrillapp.com.
```bash
SMTP_ADDRESS=smtp.mandrillapp.com
SMTP_AUTHENTICATION=plain
SMTP_DOMAIN=<Your verified domain in Mailchimp>
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_PORT=587
SMTP_USERNAME=<Your SMTP username displayed under Settings -> SMTP & API info>
SMTP_PASSWORD=<Any valid API key, create an API key under Settings -> SMTP & API Info>
```
### Configure frontend URL
Provide the following value as frontend url
```bash
FRONTEND_URL='http://localhost:3000'
```
### Configure default language
```bash
DEFAULT_LOCALE='en'
```
### Configure storage
Chatwoot uses [active storage](https://edgeguides.rubyonrails.org/active_storage_overview.html) for storing attachments. The default storage option is the local storage on your server.
But you can change it to use any of the cloud providers like amazon s3, microsoft azure and google gcs etc. Refer [configuring cloud storage](./configuring-cloud-storage) for additional environment variables required.
```bash
ACTIVE_STORAGE_SERVICE='local'
```
### Configure Redis
For development, you can use the following url to connect to redis.
```bash
REDIS_URL='redis:://127.0.0.1:6379'
```
To authenticate redis connections made by app server and sidekiq, if it's protected by a password, use the following
environment variable to set the password.
```bash
REDIS_PASSWORD=
```
### Configure Postgres host
You can set the following environment variable to set the host for postgres.
```bash
POSTGRES_HOST=localhost
```
For production and testing you have the following variables for defining the postgres database,
username and password.
```bash
POSTGRES_DATABASE=chatwoot_production
POSTGRES_USERNAME=admin
POSTGRES_PASSWORD=password
```
### Rails Production Variables
For production deployment, you have to set the following variables
```bash
RAILS_ENV=production
SECRET_KEY_BASE=replace_with_your_own_secret_string
```
You can generate `SECRET_KEY_BASE` using `rake secret` command from project root folder.
### Rails Logging Variables
By default chatwoot will capture `info` level logs in production. Ref [rails docs](https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels) for the additional log level options.
We will also retain 1 GB of your recent logs and your last shifted log file.
You can fine tune these settings using the following environment variables
```bash
# possible values: 'debug', 'info', 'warn', 'error', 'fatal' and 'unknown'
LOG_LEVEL=
# value in megabytes
LOG_SIZE= 1024
```
### Push Notification
Chatwoot uses web push for push notification on the dashboard. Inorder to get the push notifications working you have to setup the following [VAPID](https://tools.ietf.org/html/draft-thomson-webpush-vapid-02) keys.
```bash
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
```
If you are comfortable with the Rails console, you could run `rails console` and run the following commands
```rb
vapid_key = Webpush.generate_key
# Copy the following to environment variables
vapid_key.public_key
vapid_key.private_key
```
Or you can generate a VAPID key from https://d3v.one/vapid-key-generator/
### Using CDN for asset delivery
With the release v1.8.0, we are enabling CDN support for Chatwoot. If you have a high traffic website, we recommend to setup CDN for your asset delivery. Read setting up [CloudFront as your CDN](/docs/deployment/cdn/cloudfront) guide.

View file

@ -1,39 +0,0 @@
---
path: "/docs/common-errors"
title: "Common Errors"
---
### Errors you might encounter while setting up the project
#### Redis connection error
```bash
ArgumentError: invalid uri scheme
```
This is an error thrown from redis connector. You might not have setup the redis environment variables properly. Please refer to dependencies section to install redis-server and [Configure Redis URL](https://www.chatwoot.com/docs/environment-variables) in the environment-variables section.
#### pg gem Installation error
If you see the following error while bundle installation, provide the Postgres path as pg_config.
```
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
An error occurred while installing pg (1.2.3), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.2.3' --source 'https://rubygems.org/'`
succeeds before bundling.
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
```
To fix this, try executing
```
gem install pg -v '1.2.3' --source 'https://rubygems.org/' -- --with-pg-config=path-to-postgres-installation/12/bin/pg_config
```

View file

@ -1,65 +0,0 @@
---
path: "/docs/facebook-setup"
title: "Setting Up Facebook"
---
### Register A Facebook App
To use Facebook Channel, you have to create an Facebook app in developer portal. You can find more details about creating Facebook channels [here](https://developers.facebook.com/docs/apps/#register)
Once you register your Facebook App, you will have to obtain the `App Id` and `App Secret` . These values will be available in the app settings and will be required while setting up Chatwoot environment variables.
### Configure the Facebook App
1) In the app settings add your `Chatwoot installation url` as your app domain.
2) In the products section in your app settings page, Add Messenger
3) Go to the Messenger settings and configure the call Back URL with `{your_chatwoot_url}/bot`
4) Configure a `verify token`, you will need this value for configuring the chatwoot environment variables
5) You might have to add a Facebook page to your `Access Tokens` section in your Messenger settings page if your app is still in development.
6) You will also have to add your Facebook page to webhooks sections in your messenger settings with all the webhook events checked.
### Configuring the Environment Variables in Chatwoot
Configure the following Chatwoot environment variables with the values you have obtained during the facebook app setup.
```bash
FB_VERIFY_TOKEN=
FB_APP_SECRET=
FB_APP_ID=
```
### Things to note before going into production.
Before you can start using your Facebook app in production, you will have to get it verified by Facebook. Refer the [docs](https://developers.facebook.com/docs/apps/review/) on getting your app verified.
### Developing or Testing Facebook Integration in You Local
Install [ngrok](https://ngrok.com/docs) on your machine. This will be required since Facebook Messenger API's will only communicate via https.
```bash
brew cask install ngrok
```
Configure ngrok to route to your Rails server port.
```bash
ngrok http 3000
```
Go to Facebook developers page and navigate into your app settings. In the app settings, add `localhost` as your app domain.
In the Messenger settings page, configure the callback url with the following value.
```bash
{your_ngrok_url}/bot
```
Update verify token in your Chatwoot environment variables.
You will also have to add a Facebook page to your `Access Tokens` section in your Messenger settings page.
Restart the Chatwoot local server. Your Chatwoot setup will be ready to receive Facebook messages.
### Test your local Setup
1. After finishing the set up above, [create a Facebook inbox](/docs/channels/facebook) after logging in to your Chatwoot Installation.
2. Send a message to your page from Facebook.
3. Wait and confirm incoming requests to `/bot` endpoint in your ngrok screen.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 KiB

View file

@ -1,122 +0,0 @@
---
path: "/docs/quick-setup"
title: "Quick Setup"
---
### Install Ruby dependencies
Use the following command to install ruby dependencies.
```bash
bundle
```
If you face issue with pg gem, please refer to [Common Errors](/docs/common-errors#pg-gem-installation-error)
### Install JavaScript dependencies
```bash
yarn
```
This would install all required dependencies for Chatwoot application.
### Setup environment variables.
```
cp .env.example .env
```
Please refer to [environment-variables](./environment-variables) to read on setting environment variables.
### Setup rails server
```bash
# run db migrations
bundle exec rake db:create
bundle exec rake db:reset
# fireup the server
foreman start -f Procfile.dev
```
### Login with credentials
```bash
http://localhost:3000
user name: john@acme.inc
password: 123456
```
### Docker for development
The first time you start your development environment run the following two commands:
```bash
# build and start the services
docker-compose up --build
# prepare the database
docker-compose exec server bundle exec rails db:prepare
```
Then browse http://localhost:3000
```bash
# To stop your environment use Control+C (on Mac) CTRL+C (on Win) or
docker-compose down
# start the services
docker-compose up
```
When you change the services Dockerfile or the contents of the build directory, run stop then build. (For example after modifying package.json or Gemfile)
```bash
docker-compose stop
docker-compose build
```
The docker-compose environment consists of:
- chatwoot server
- postgres
- redis
- webpacker-dev-server
If in case you encounter a seeding issue or you want reset the database you can do it using the following command :
```bash
docker-compose run -rm server bundle exec rake db:reset
```
This command essentially runs postgres and redis containers and then run the rake command inside the chatwoot server container.
### Running Cypress Tests
Refer the docs to learn how to write cypress specs
https://github.com/shakacode/cypress-on-rails
https://docs.cypress.io/guides/overview/why-cypress.html
```
# in terminal tab1
overmind start -f Procfile.test
# in terminal tab2
yarn cypress open --project ./test
```
### Debugging Docker for production
You can use our official Docker image from [https://hub.docker.com/r/chatwoot/chatwoot](https://hub.docker.com/r/chatwoot/chatwoot)
```bash
docker pull chatwoot/chatwoot
```
You can create an image yourselves by running the following command on the root directory.
```bash
docker-compose -f docker-compose.production.yaml build
```
This will build the image which you can depoy in Kubernetes (GCP, Openshift, AWS, Azure or anywhere), Amazon ECS or Docker Swarm. You can tag this image and push this image to docker registry of your choice.
Remember to make the required environment variables available during the deployment.

View file

@ -1,38 +0,0 @@
---
path: "/docs/slack-integration-setup"
title: "Setting Up Slack Integration"
---
### Register a Slack app
To use Slack Integration, you have to create a Slack app in the developer portal. You can find more details about creating Slack apps [here](https://api.slack.com/)
Once you register your Slack App, you will have to obtain the `Client Id` and `Client Secret`. These values will be available in the app settings and will be required while setting up Chatwoot environment variables.
### Configure the Slack app
1) Create a slack app and add it to your development workspace.
2) Obtain the `Client Id` and `Client Secret` for the app and configure it in your Chatwoot environment variables.
3) Head over to the `OAuth & permissions` section under `features` tab.
4) In the redirect URLs, Add your Chatwoot installation base url.
5) In the scopes section configure the given scopes for bot token scopes. `commands,chat:write,channels:read,channels:manage,channels:join,groups:write,im:write,mpim:write,users:read,users:read.email,chat:write.customize,channels:history,groups:history,mpim:history,im:history`
6) Head over to the `events subscriptions` section under `features` tab.
7) Enable events and configure the given request url `{chatwoot installation url}/api/v1/integrations/webhooks`
8) Subscribe to the following bot events `message.channels` , `message.groups`, `message.im`, `message.mpim`
9) Connect slack integration on Chatwoot app and get productive.
### Configuring the environment variables in Chatwoot
Configure the following Chatwoot environment variables with the values you have obtained during the slack app setup.
```bash
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
```
### Test your setup
1. Ensure that you are receiving the Chatwoot messages in the `customer-conversations` channel.
2. Add a message to that thread and ensure it is coming back on to Chatwoot
3. Add `note:` or `private:` in front on the Slack message see if it is coming out as private notes
4. If your Slack member's email matches their email on Chatwoot, the messages will be associated with their Chatwoot user account.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 KiB

View file

@ -1,60 +0,0 @@
---
path: "/docs/configuring-s3-bucket-as-cloud-storage"
title: "Configuring S3 Bucket as storage in Chatwoot"
---
### Using Amazon S3
You can get started with [Creating an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html) and [Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) to configure the following details.
Configure the following env variables.
```bash
ACTIVE_STORAGE_SERVICE='amazon'
S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
```
### S3 Bucket policy
Inorder to use S3 bucket in Chatwoot, a policy has to be set with the correct credentials. A sample policy is given below, as the listed actions are required for the storage to work.
```json
{
"Version": "2012-10-17",
"Id": "Policyxxx",
"Statement": [
{
"Sid": "Stmtxxx",
"Effect": "Allow",
"Principal": {
"AWS": "your-user-arn"
},
"Action": [
"s3:DeleteObject",
"s3:GetObject",
"s3:ListBucket",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}
```
Replace your *bucket name* in the appropriate places.
**User ARN** can be found using the following steps:
1. Login to AWS Console. Go to IAM, and click on Users from the left sidebar. You will be to see the list of users as follows.
![s3-users-list](./images/s3-users-list.png)
2. Click on the user, you will be to see a screen as shown below. Copy the User ARN and paste it in the above policy.
![user-arn](./images/user-arn.png)

View file

@ -1,56 +0,0 @@
---
path: "/docs/twitter-app-setup"
title: "Twitter App Setup"
---
Twitter channel with Chatwoot requires access to Twitter APIs. We are using Account Activity API. If you don't have an access to Twitter Business APIs, apply for one at [Twitter developer portal](https://developer.twitter.com/en/apply-for-access).
![apply_to_twitter](./images/twitter/apply_to_twitter.png)
Once your application is approved, you will be able to add Twitter Apps and dev environments. If you have applied for a team account, you will able to invite more team members. Inorder for the channel to work you will have to set the following environment variables. We will be describing what it means in the following sections.
```bash
TWITTER_APP_ID=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ENVIRONMENT=
```
### Create a Twitter App
URL: https://developer.twitter.com/en/apps/create
Create a Twitter by filling all the required fields in the above link.
#### Things to note:
1. Enable Sign in with Twitter
2. Configure the callback url as `{your_chatwoot_installation_url}/twitter/callback`
After you create the app, you will be able to see a tab `Keys and Tokens`.
Use `API key` under `Consumer API keys` as `TWITTER_CONSUMER_KEY` in Chatwoot.
Use `API secret key` under `Consumer API keys` as `TWITTER_CONSUMER_SECRET` in Chatwoot.
![keys_and_tokens](./images/twitter/keys_and_tokens.png)
Go to your apps, you will able to see your app id. Use this app id as `TWITTER_APP_ID` in Chatwoot.
![apps](./images/twitter/apps.png)
### Create a dev environment
Inorder for the DMs and Tweets to work in realtime, you need to set up Account Activity API dev environment as follows.
URL: https://developer.twitter.com/en/account/environments
![dev_environment](./images/twitter/dev_environment.png)
Click on `Set up dev environment`. You will be able to see a form as follows.
Provide a `Dev Environment Label`, this should be an alphanumeric string. Use the same string as `TWITTER_ENVIRONMENT` in Chatwoot.
![setup_dev_environment](./images/twitter/setup_dev_environment.png)
Once you do this, you will ready to use Twitter Channels. To connect your Twitter Account, follow this [guide](/docs/channels/twitter).

View file

@ -1,4 +0,0 @@
<script>
window.location.href = 'https://www.chatwoot.com/docs'
</script>

View file

@ -1,32 +0,0 @@
---
path: "/docs/self-hosted/enable-ip-logging"
title: "Enable IP Logging"
---
Chatwoot allows you to identify the location of the user by geocoding the IP address. For IP Address geocoding, we support MaxmindDB services. This lookup provides methods for geocoding IP addresses without making a call to a remote API everytime. To setup your self-hosted instance with the geocoding, follow the steps below.
**Step 1:** Create an account at [MaxmindDB](https://www.maxmind.com) and create an API key.
**Step 2:** Add the following environment variables.
```bash
IP_LOOKUP_SERVICE=geoip2
IP_LOOKUP_API_KEY=your-api-key
```
With this step, Chatwoot would automatically download the [MaxmindDB downloadable databases](https://dev.maxmind.com/geoip/geoip2/downloadable/) and cache it locally.
**Step 3:** Enable IP Lookup on your account.
Login to Rails console
```
RAILS_ENV=production bundle exec rails console
```
```rb
account_id = 1 // Please fill your account id instead of 1
account = Account.find(account_id)
account.enable_features('ip_lookup')
account.save!
```

View file

@ -1,75 +0,0 @@
---
path: "/docs/self-hosted/storage/configuring-gcs"
title: "Configure GCS as storage in Chatwoot"
---
Chatwoot supports Google Cloud storage as the storage provider. To enable GCS in Chatwoot, follow the below mentioned steps.
Set google as the active storage service in the environment variables
```bash
ACTIVE_STORAGE_SERVICE='google'
```
### Get project ID variable
Login to your Google Cloud console. On your home page of your project you will be able to see the project id and project name as follows.
![get-your-project-id](./images/get-your-project-id.png)
```bash
GCS_PROJECT=your-project-id
```
### Setup GCS Bucket
Go to Storage -> Browser. Click on "Create Bucket". You will be presented with a screen as shown below. Select the default values and continue.
![create-a-bucket](./images/create-a-bucket.png)
Once this is done you will get the bucket name. Set this as GCS_BUCKET.
```
GCS_BUCKET=your-bucket-name
```
### Setup a service account
Go to `Identity & Services -> Identity -> Service Accounts`. Click on "Create Service Account".
Provice a name and an ID for the service account, click on create. You will be asked to "Grant this service account access to the project" Select Cloud Storage -> Storage Admin as shown below.
![storage-admin](./images/storage-admin.png)
### Add service account to the bucket
Go to Storage -> Browser -> Your bucket -> Permissions. Click on add. On "New members" field select the service account you just created.
Select role as `Cloud Storage -> Storage Admin` and save.
![permissions](./images/permissions.png)
### Generate a key for the service account
Go to `Identity & Services -> Identity -> Service Accounts -> Your service account`. There is a section called **Keys**. Click on **Add Key**. You will be presented with an option like the one below. Select JSON from the option.
![json](./images/json.png)
Copy the json file content and set it as GCS_CREDENTIALS
A sample credential file is of the following format.
```json
{
"type": "service_account",
"project_id": "",
"private_key_id": "",
"private_key": "",
"client_email": "",
"client_id": "",
"auth_uri": "",
"token_uri": "",
"auth_provider_x509_cert_url": "",
"client_x509_cert_url": ""
}
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 KiB

View file

@ -1,130 +0,0 @@
---
path: "/docs/webhooks"
title: "Webhooks"
---
Webhooks are HTTP callbacks which can be defined for every account. They are triggered by events like message creation in Chatwoot. You can create more than one webhook for an account. Currently webhooks support only `message_created` event
**Step 1**. Click on Integrations link is settings sidebar. Click on "Configure" button.
![integrations](./images/integrations.png)
**Step 2**. You will see the list of webhooks you have already added to the account.
![configure](./images/configure.png)
**Step 3**. Click on the "Add new webhook", it will display a modal where you can input the URL to which the POST request should be sent.
![add-a-webhook](./images/add-a-webhook.png)
Chatwoot currently supports webhooks for message creation only. Once a new message is created in the any of the inboxes of the account, it will send a POST request with the following payload to the configured URLs.
### A sample webhook payload
```json
{
"event": "message_created", // The name of the event
"id": "1", // Message ID
"content": "Hi", // Content of the message
"created_at": "2020-03-03 13:05:57 UTC", // Time at which the message was sent
"message_type": "incoming", // This will have a type incoming, outgoing or template. Incoming messages are sent by the user from the widget, Outgoing messages are sent by the agent to the user.
"content_type": "enum", // This is an enum, it can be input_select, cards, form or text. The message_type will be template if content_type is one og these. Default value is text
"content_attributes": {} // This will an object, different values are defined below
"source_id": "", // This would the external id if the inbox is a Twitter or Facebook integration.
"sender": { // This would provide the details of the agent who sent this message
"id": "1",
"name": "Agent",
"email": "agent@example.com"
},
"contact": { // This would provide the details of the user who sent this message
"id": "1",
"name": "contact-name"
},
"conversation": { // This would provide the details of the conversation
"display_id": "1", // This is the ID of the conversation which you can see in the dashboard.
"additional_attributes": {
"browser": {
"device_name": "Macbook",
"browser_name": "Chrome",
"platform_name": "Macintosh",
"browser_version": "80.0.3987.122",
"platform_version": "10.15.2"
},
"referer": "http://www.chatwoot.com",
"initiated_at": "Tue Mar 03 2020 18:37:38 GMT-0700 (Mountain Standard Time)"
}
},
"account": { // This would provide the details of the account
"id": "1",
"name": "Chatwoot",
}
}
```
### Content Attributes
#### 1. Options
```json
{
"items": [
{
"title": "Option 1",
"value": "option_1"
},
{
"title": "Option 2",
"value": "option_2"
}
],
"submitted_values": [
{
"title": "Option 1",
"value": "option_1"
}
]
}
```
#### 2. Form
```json
{
"items": [
{
"type": "text/text_area/email",
"placeholder": "Placeholder",
"name": "unique_name_of_the_field",
"label": "Label"
},
],
"submitted_values": [
{
"name": "unique_name_of_the_field 1",
"value": "sample_value"
}
]
}
```
#### 3. Cards
```json
{
"items": [
{
"media_url": "", // Url of the image to be displayed
"title": "", // Title of the card
"description": "", // Description of the card
"actions": [
{
"type": "link",
"text": "View More",
"uri": "" // Link to the website
}
]
},
],
}
```

Some files were not shown because too many files have changed in this diff Show more