<commit_before>'use strict';
const request         = require('../comum/tago_request.js');
const config          = require('../config.js');
const default_headers = require('../comum/default_headers.js');

class Email {
    constructor(acc_token) {
        this.token = acc_token;
        this.default_options = {
            'json':    true,
            'headers': default_headers(this)
        };
    }

    /** Send email
     * @param  {string} to - E-mail address to be sent.
     * @param  {string} subject - Subject of the e-mail
     * @param  {string} message - Message scope for the e-mail
     * @param  {string} [from] - E-mail to be indicated for reply
     * @return {Promise}
     */
    send(to, subject, message, from) {
        let url    = `${config.api_url}/analysis/services/email/send`;
        let method = 'POST';
        let data = { to, subject, message, from };

        let options = Object.assign({}, this.default_options, {url, method, data});
        return request(options);
    }


}

module.exports = Email;<commit_msg>Updated email service with attachment<commit_after>'use strict';
const request         = require('../comum/tago_request.js');
const config          = require('../config.js');
const default_headers = require('../comum/default_headers.js');

class Email {
    constructor(acc_token) {
        this.token = acc_token;
        this.default_options = {
            'json':    true,
            'headers': default_headers(this)
        };
    }

    /** Send email
     * @param  {string} to - E-mail address to be sent.
     * @param  {string} subject - Subject of the e-mail
     * @param  {string} message - Message scope for the e-mail
     * @param  {string} [from] - E-mail to be indicated for reply (optional)
     * @param  {JSON} attachment - Message scope for the e-mail
     * @param  {string} attachment.archive - archive itself
     * @param  {string} attachment.filename - Name for the archive
     * @return {Promise}
     */
    send(to, subject, message, from, attachment) {
        let url    = `${config.api_url}/analysis/services/email/send`;
        let method = 'POST';
        let data = { to, subject, message, from, attachment };

        let options = Object.assign({}, this.default_options, {url, method, data});
        return request(options);
    }


}

module.exports = Email;
{'fraction_non_alphanumeric': 0.13435374149659865, 'fraction_numerical': 0.0, 'mean_word_length': 2.371060171919771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2082601', 'n_tokens_mistral': 686, 'n_tokens_neox': 680, 'n_words': 194}