Tech Settings > Embed Script`. It should look something like this, but with your domain in place of ``:
+```
+
+
+```
+
+## Triggering the Comments Section (client side, i.e. Your site)
+
+When the embed script is triggered on your page load several things are initiated inside Talk, including fetching all comments for the specified article, establishing websocket connections for this user, and checking user’s session for SSO/authentication.
+
+Instead of greedily triggering the embed to render on _EVERY PAGE LOAD_, we highly recommend implementing a _“lazy”_ rendering strategy to only render the comments section if a user wants to interact with it. This will greatly improve your initial page load performance, and will be critical to managing server resources if you’re running Talk on a heavy-traffic production site.
+
+We recommend using one of these _“lazy”_ loading strategies:
+
+#### Scroll to Comments Section
+Wait for user to scroll to the comment section before triggering the embed to render.
+
+You can pass lazy: true to the render options, like so:
+```
+Coral.Talk.render(document.getElementById('container'), {
+ talk: 'https://my-talk-installation.com',
+ lazy: true,
+});
+```
+
+Or you can enable lazy rendering by default on all assets using ENV variable `TALK_DEFAULT_LAZY_RENDER=TRUE`
+
+_*Note: This feature requires Talk version 4.6.8 or greater_
+
+#### Show Comments Button
+ You can hide the comments section until a user clicks button, then trigger the embed to render
+
+This example uses jQuery to render the embed on the button's click event
+```
+
+
+
+
+
+
+
+```
+
+## Creating Assets in Talk (server side, i.e. What you need to send to Talk)
One of the most frequent questions that we get asked by organizations trying to
integrate Talk is: _How do we hook our CMS up to Talk so that articles are in
sync?_
-This guide is designed to explain the steps to take your base installation of
-Talk and configure it to allow only assets pushed into it from your CMS, and
-keep your URL/title in sync. We won't cover here how to install the plugin, as
-it is covered in our [Plugins Overview](/talk/plugins/).
+### “Lazy Asset Creation”
+Talk’s provided embed script by default dynamically generates Assets in Talk based on each unique url that triggers it. The url must reference an existing Permitted Domain. If your articles/stories always have unique urls, then you will not need to modify the default behavior.
-## Why do we need to create a plugin?
+Assets created in this way will then be scraped to load metadata, see [Asset Scraping](/talk/integrating/asset-scraping/)
-By default, Talk will use "Lazy Asset Creation" to dynamically generate Assets
-in Talk in order to make it easier for lighter installations. In order to have
-more strict control over this flow, we will create a plugin that will:
+## Customizing the Integration with a Plugin
+In order to have more strict control over the asset creation flow to allow only assets pushed into it from your CMS, and keep your URL/title in sync we will create a plugin.
+We will create a plugin that will:
1. Disable "Lazy Asset Creation" by [Overriding a Resolver](#overriding-a-resolver).
2. Create Assets from our CMS by [Creating a New Asset Route](#creating-a-new-asset-route).
@@ -25,6 +83,9 @@ more strict control over this flow, we will create a plugin that will:
We will then modify our embed so that we can [Target the Asset](#target-the-asset).
+
+This guide is designed to explain the steps to take your base installation of Talk and configure it. We won't cover here how to install the plugin, as it is covered in our [Plugins Overview](/talk/plugins/).
+
But first we should grab our basic plugin structure:
```sh
diff --git a/docs/source/integrating/notifications.md b/docs/source/integrating/notifications.md
index a5f625083..04fe8f59f 100644
--- a/docs/source/integrating/notifications.md
+++ b/docs/source/integrating/notifications.md
@@ -3,22 +3,13 @@ title: Notifications
permalink: /integrating/notifications/
---
-Talk currently supports 3 types of email notifications.
+There are several plugins included with Talk that once enabled will control how and when Talk sends emails to users based on user activity. Only basic user profile notifications are enabled by default.
-
-1. When someone replies to my comment
-2. When a staff member replies to my comment
-3. When my comment gets featured
-
-Talk support 3 options for notification frequency: immediately, hourly or daily. Commenters can also opt-out of email notifications. Notifications are set to OFF by default.
-
-Commenters cannot enable notifications until they have verified their email.
-
-Note: Notifications are not currently supported for users that sign-up via Facebook or Google auth, or don't have an email attached to their account for any other reason.
+_NOTE: Notifications are only supported for users that have an email address in Talk! If you are using authenticate via Facebook, Google, or SSO and you want to persist the user’s email, you will also need to enable `talk-plugin-local-auth` ([See Authentication](/talk/integrating/authentication/))_
### Configuring SMTP
-You must setup SMTP to use notifications. The following ENV variables must be set:
+You must setup SMTP to send email notifications. The following ENV variables must be set:
```
TALK_SMTP_FROM_ADDRESS=email@email.com
@@ -28,28 +19,74 @@ TALK_SMTP_HOST=smtp.domain.net
TALK_SMTP_PORT=2525
```
-### Enabling Notifications
+See our documentation on [setting env variables](/talk/advanced-configuration/#talk-smtp-from-address) for reference.
-Enabling the `talk-plugin-notifications` creates a NotificationManager that creates and manages events send from the event emitter that is linked to the Graph API PubSub system.
+When running Talk in production we recommend using a 3rd party mail service provider like SendGrid or MailGun.
-Adding the `talk-plugin-notifications` plugin will also enable the `notifications` plugin hook. Any plugin that registers before the `talk-plugin-notifications` plugin will get picked up by.
+If you are having difficulty with your SMTP settings you can add `DEBUG=talk:jobs:mailer` to your .env to see additional logs from the mailer service.
-See https://github.com/coralproject/talk/blob/8b669a31c551a042f0f079d8cfc16825673eb8f0/plugins/talk-plugin-notifications-reply/index.js for an example.
+All notifications require SMTP settings to be correctly configured first, then enable the corresponding plugin, and configure any settings in the Talk Admin. If SMTP is not enabled, it will log to the server console that some variables were not provided.
-### Notification Categories
+### Notification Types & Plugins
-Talk currently supports the following Notifications options out of the box:
+In addition to the core notifications included with Talk, some plugins add features that are supported by and will add additional types of email notifications. Commenters can opt-out of most email notifications, and comment activity notifications are set to OFF by default. Commenters cannot enable notifications until they have verified their email.
-`talk-plugin-notifications-category-reply`
-`talk-plugin-notifications-category-staff-reply`
-`talk-plugin-notifications-category-featured`
+You can see a list of all the plugins related to notifications by visiting:
+https://docs.coralproject.net/talk/plugins-directory/?q=notifications
+
+#### Type: User Profile Notifications (Included by Talk core)
+
+* When user registers, sends email confirmation and verification
+* When user requests password reset
+* When user changes username, sends confirmation
+* When a user is banned or suspended
+
+_NOTE: Users can not opt-out of User Profile Notifications_
+
+#### Type: GDPR Notifications (optional)
+`talk-plugin-profile-data:`
+* When my comment history is ready for download (only one link can be generated every 7 days, and the link is valid for 24 hours)
+
+`talk-plugin-local-auth:`
+* When user changes their email address
+* When a user adds a new email address
+
+#### Type: Comment Activity Notifications (optional)
+Talk support 3 options for notification frequency for this type of notification:
+* immediately
+* hourly
+* daily
+
+`talk-plugin-notifications:`
+* Enables notifications configuration (required for all comment activity notifications below)
+
+`talk-plugin-notifications-category-reply:`
+* When someone replies to my comment
+
+`talk-plugin-notifications-category-staff-reply:`
+* When a staff member replies to my comment
+
+`talk-plugin-notifications-category-featured:`
+* When my comment gets featured
### Notification Digests
+Notification digests are enabled by enabling the corresponding plugin, otherwise comment activity notifications are sent immediately.
+* `talk-plugin-notifications-digest-daily`
+* `talk-plugin-notifications-digest-hourly`
+
Talk supports hourly and daily digests out the box, if you would like to create your own, refer to the below:
https://github.com/coralproject/talk/blob/9cc9969320dca47bb0f8f81e8d944ae4d19e548b/plugins/talk-plugin-notifications/server/connect.js#L69-L102
+
+### Customizing Notifications
+
+Enabling the `talk-plugin-notifications` creates a NotificationManager that creates and manages events send from the event emitter that is linked to the Graph API PubSub system. This allows the instance that received the mutation to also fire off a notification job that can be handled. It also enabels the `notifications` plugin hook. Any plugin that registers after the `talk-plugin-notifications` can export the notifications plugin to reference it.
+
+See https://github.com/coralproject/talk/blob/8b669a31c551a042f0f079d8cfc16825673eb8f0/plugins/talk-plugin-notifications-reply/index.js for an example.
+
+
### Connect API
This exposes the `graph/connectors.js` via the `connect` hook.
@@ -67,3 +104,12 @@ See https://github.com/coralproject/talk/blob/90290cfa2de88e62f687e1ed0235ba6dfe
### Email Templates
Email templates are text based and support translations. If you would like to create a new email template, you can register it via the Connect API, see https://github.com/coralproject/talk/blob/8b669a31c551a042f0f079d8cfc16825673eb8f0/plugins/talk-plugin-notifications/server/connect.js#L12-L28###
+
+Any email template registered with the same name as another template will replace the existing template for that type of email. _NOTE: that also means that the template data sent to each email template will __not__ change, so bear that in mind when designing templates that you may not have rich access to data._
+
+An example of this is with the `talk-plugin-notifications-category-featured` plugin:
+
+Notification translation is located: https://github.com/coralproject/talk/blob/dd0601a80132d2849c53ef7eaf12ff382f3920b9/plugins/talk-plugin-notifications-category-featured/translations.yml#L13
+
+Where the template content is provided: https://github.com/coralproject/talk/blob/dd0601a80132d2849c53ef7eaf12ff382f3920b9/plugins/talk-plugin-notifications-category-featured/index.js#L79
+
diff --git a/docs/source/plugins/overview.md b/docs/source/plugins/overview.md
index 1f734edeb..b4e1f41d5 100644
--- a/docs/source/plugins/overview.md
+++ b/docs/source/plugins/overview.md
@@ -67,9 +67,9 @@ External plugins can be resolved by running:
This achieves two things:
1. It will traverse into local plugin folders and install their dependencies.
- _Note that if the plugin is already installed and available in the
+ __Note that if the plugin is already installed and available in the
node_modules folder, it will not be fetched again unless there is a version
- mismatch._ This will result in the project `package.json` and `yarn.lock`
+ mismatch.__ This will result in the project `package.json` and `yarn.lock`
files to be modified, this is normal as this ensures that repeated deployments
(with the same config) will have the same config, these changes should not be
committed to source control.
diff --git a/locales/de.yml b/locales/de.yml
index 53e44f46a..06653c5c6 100644
--- a/locales/de.yml
+++ b/locales/de.yml
@@ -136,6 +136,7 @@ de:
code_of_conduct_summary_desc: 'Verfassen Sie eine Einleitung, die über jedem Kommentarbereich erscheint. Nützlich z.B. für Community-Richtlinien.'
include_question_here: 'Stellen Sie Ihre Frage hier:'
include_text: 'Fügen Sie Ihren Text hier ein.'
+ include_an_icon: 'Fügen Sie ein Icon hinzu'
moderate: Moderieren
moderation_settings: Moderations-Einstellungen
open: Öffnen
diff --git a/locales/en.yml b/locales/en.yml
index 41a036528..02f9876d2 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -139,6 +139,7 @@ en:
hours: Hours
code_of_conduct_summary: 'Summary of your Code of Conduct'
code_of_conduct_summary_desc: 'This message will appear above every comments stream on your site. Click here to learn more about writing a good code.'
+ include_an_icon: 'Include an Icon'
include_question_here: 'Write your question here:'
include_text: 'Include your text here.'
moderate: Moderate
diff --git a/package.json b/package.json
index b1f4b5a56..fce56b057 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "talk",
- "version": "4.6.10",
+ "version": "4.7.0",
"description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net",
"main": "app.js",
"private": true,
@@ -205,6 +205,7 @@
"style-loader": "^0.16.0",
"subscriptions-transport-ws": "^0.7.2",
"supports-color": "^4",
+ "throng": "^4.0.0",
"timeago.js": "^2.0.3",
"timekeeper": "^1.0.0",
"tlds": "^1.196.0",
diff --git a/plugins/talk-plugin-facebook-auth/README.md b/plugins/talk-plugin-facebook-auth/README.md
index 08780adda..839265b04 100644
--- a/plugins/talk-plugin-facebook-auth/README.md
+++ b/plugins/talk-plugin-facebook-auth/README.md
@@ -29,6 +29,8 @@ Configuration:
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
+_NOTE: FabceBook auth requires your site to use `https` (SSL) not `http`. If your site is not `https` you can not use this plugin!_
+
## GDPR Compliance
In order to facilitate compliance with the
diff --git a/services/kue.js b/services/kue.js
index 380f6a8c5..9db766d0e 100644
--- a/services/kue.js
+++ b/services/kue.js
@@ -91,12 +91,12 @@ class Task {
static shutdown() {
debug('Shutting down the Queue');
- return new Promise((resolve, reject) => {
+ return new Promise(resolve => {
// Shutdown and give the queue 5 seconds to shutdown before we start
// killing jobs.
getQueue().shutdown(5000, err => {
if (err) {
- return reject(err);
+ return resolve();
}
debug('Queue shut down.');
diff --git a/yarn.lock b/yarn.lock
index 8d904c9f7..e5f1afb14 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -12823,6 +12823,13 @@ throat@^4.0.0:
resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a"
integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=
+throng@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/throng/-/throng-4.0.0.tgz#983c6ba1993b58eae859998aa687ffe88df84c17"
+ integrity sha1-mDxroZk7WOroWZmKpof/6I34TBc=
+ dependencies:
+ lodash.defaults "^4.0.1"
+
through2@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"