GithubHelp home page GithubHelp logo

analog-nico / pxl-for-emails Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 11.0 27 KB

Open and click tracking for html emails – hosted by any Express-based node.js app

License: ISC License

JavaScript 100.00%

pxl-for-emails's People

Contributors

analog-nico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pxl-for-emails's Issues

{ TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type object at validChunk

var nodemailer = require('nodemailer');
var csv = require('csv');
var fs = require('fs');
let Pxl = require('pxl-mongodb');
let express = require('express');
let PxlMongodb = require('pxl-mongodb')
let msg = '<img src = "https://drive.google.com/file/d/1cToTGU25lbKG2yX9Bmhew6tM9vZYLOxP/view?usp=sharing" /> Hey man'


let pxl = new Pxl();
pxl.connect('mongodb://......', {})

let app = express()
 
app.use(pxl.trackPxl)
app.get('/shortly/:linkId', pxl.redirect)
let PxlForEmails = require('pxl-for-emails')
 
let pxlForEmails = new PxlForEmails({
    pxl,
    getFullShortenedLink(linkId) {
        return `https://localhost:3000/shortly/${ linkId }`
    }
})


    let newmsg = pxlForEmails.addTracking(msg, {recipient: "[email protected]"})
    


var mailOptions = {
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Do you need a professional Website for your business?',
    html: newmsg
};


var transporter = nodemailer.createTransport({
    service: 'gmail',
    auth:{
        user: '[email protected]',
        pass: 'xxxx'
    }
});


        
transporter.sendMail(mailOptions,function(error,info){
            if(error){
                console.log(error);
            }
            else{
                console.log('Email sent : ' + info.response);
            }
        });

Error log:

{ TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type object
    at validChunk (_stream_writable.js:258:10)
    at PassThrough.Writable.write (_stream_writable.js:292:21)
    at PassThrough.Writable.end (_stream_writable.js:579:10)
    at Immediate.setImmediate [as _onImmediate] (D:\Marketing\Mailer\node_modules\nodemailer\lib\mime-node\index.js:978:46)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5) code: 'ESTREAM', command: 'API' }

It gets connected to the database but not updating the database. I think I'm having trouble with 'addTracking' method. Any kind of help will be appreciated. Thank you.

Nodemailer Example

hey nice work but can you provide us with full example with node nodemailer??

thanks for awesome work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.