<commit_before>// Deliver notification via email
//
'use strict';


const user_info = require('nodeca.users/lib/user_info');
const render    = require('nodeca.core/lib/system/render/common');


module.exports = function (N) {
  N.wire.after('internal:users.notify.deliver', function* notify_deliver_email(local_env) {

    // TODO: filter offline users


    // Fetch users emails
    //
    let res = yield N.models.users.AuthLink
                        .find()
                        .where('user_id').in(Object.keys(local_env.messages))
                        .where('type').equals('plain')
                        .lean(true);

    let emails = res.reduce((acc, link) => {
      acc[link.user_id] = link.email;
      return acc;<commit_msg>Don't use AuthLink to get user email<commit_after>// Deliver notification via email
//
'use strict';


const user_info = require('nodeca.users/lib/user_info');
const render    = require('nodeca.core/lib/system/render/common');


module.exports = function (N) {
  N.wire.after('internal:users.notify.deliver', function* notify_deliver_email(local_env) {

    // TODO: filter offline users


    // Fetch users emails
    //
    let users_email = yield N.models.users.User.find()
                                .where('_id').in(Object.keys(local_env.messages))
                                .select('_id email')
                                .lean(true);

    let emails = users_email.reduce((acc, user) => {
      acc[user._id] = user.email;
      return acc;
{'fraction_non_alphanumeric': 0.13509933774834437, 'fraction_numerical': 0.0, 'mean_word_length': 2.2012711864406778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3429875', 'n_tokens_mistral': 458, 'n_tokens_neox': 436, 'n_words': 89}