Git Product home page Git Product logo

Comments (9)

aydrian avatar aydrian commented on August 19, 2024 3

I should be able to pull that out. I prefer to use autoenv which just loads variables from a .env file in a directory. I'll try to get a release out tomorrow.

from nodemailer-sparkpost-transport.

djensen47 avatar djensen47 commented on August 19, 2024 1

👍 I'm switching from Mandrill to Sparkpost. I'm already using nodemailer so I was hoping this would be a simple drop-in replacement but I'm using node-config for my config and not environment variables.

from nodemailer-sparkpost-transport.

crobinson42 avatar crobinson42 commented on August 19, 2024

@samholmes I agree with your remarks. I switched to using the official Sparkpost npm module because it's much more simple and maintained up to date with the available Sparkpost API.

ie:

var SparkPost = require('sparkpost');
var SparkPostClient = new SparkPost('xxxxxxxxx-xxxxxx-xxxxxxxxx');

var reqObj = {
          transmissionBody: {
            content: {
              from: '[email protected]',
              subject: 'subject',
              html: '<html><body>...',
              text: 'text body....'
            },
            recipients: [ '[email protected]' ]
          }
        };

SparkPostClient.transmissions.send(reqObj, function(err, res) { ... });

from nodemailer-sparkpost-transport.

richleland avatar richleland commented on August 19, 2024

I completely agree - thanks for opening this ticket @samholmes. We can target getting this updated for the next release. And to your point @crobinson42 we really do need to be keeping this updated and in sync with our node-sparkpost library. Thanks for the nudge you two!

from nodemailer-sparkpost-transport.

samholmes avatar samholmes commented on August 19, 2024

I switched to the official sparkpost module instead of using the nodemailer transport. Although, thanks for bring dotenv to my awareness as I may utilize that in my app! :)

from nodemailer-sparkpost-transport.

SwiftRabbit avatar SwiftRabbit commented on August 19, 2024

I have no choice to do as @samholmes did, considering the .env is still required.

from nodemailer-sparkpost-transport.

djensen47 avatar djensen47 commented on August 19, 2024

Sorry, I got things a little mixed up in my first few drafts of this comment.

For me the issue is/was:

  1. Reducing dependencies
  2. Following the pattern used by other nodemailer transports, which, it turns out, this library does indeed do
  3. Documenting that sparkPostApiKey is required in order for this transport module to work

I take it autoenv is something else entirely and not a node module?

from nodemailer-sparkpost-transport.

aydrian avatar aydrian commented on August 19, 2024

I can definitely update the docs. autoenv is just a handy little tool that will load values from a .env file in a directory. It's very helpful. For all my projects, I have a .env file that holds the environment variables needed for that project. Whenever I cd into the directory, it loads them. We should not be forcing variables to load a certain way in this library. If you use Heroku, they have a setup for loading variables as does most hosting environments.
It looks like we mainly need to better document how you can pass in a key without using an env var. I'm also going to remove the dependency for dotenv because it shouldn't be needed.

from nodemailer-sparkpost-transport.

aydrian avatar aydrian commented on August 19, 2024

This has been released to NPM as v0.1.2.

from nodemailer-sparkpost-transport.

Related Issues (16)

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.