Comments (9)
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.
👍 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.
@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.
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.
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.
I have no choice to do as @samholmes did, considering the .env is still required.
from nodemailer-sparkpost-transport.
Sorry, I got things a little mixed up in my first few drafts of this comment.
For me the issue is/was:
- Reducing dependencies
- Following the pattern used by other nodemailer transports, which, it turns out, this library does indeed do
- 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.
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.
This has been released to NPM as v0.1.2.
from nodemailer-sparkpost-transport.
Related Issues (16)
- From in object issue HOT 2
- Allow for substitution_data on individual recipient level HOT 1
- Update release scripts and documentation HOT 1
- Refactor/simplify to use mailcomposer
- Template support HOT 1
- how to fix error SparkPostError: Bad Request HOT 1
- anything we had to fix to use the europe endpoint? HOT 8
- Dev dependencies need updating HOT 1
- High security warning - need to update lodash
- Support X-MSYS-API header
- Please update dependencies
- Error: SparkPostError: Unprocessable Entity HOT 8
- Incompatible w/nodemailer API? HOT 2
- Add cc/bcc support HOT 3
- Support attachments HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodemailer-sparkpost-transport.