Comments (3)
Hi,
i didn't try any of the combination, anyway a quick fix would be to use the __dirname
global to point to the folder where your Gruntfile resides.
With path
module you can have cross platform path format too:
var path = require('path');
console.log(path.normalize(__dirname + '/path/file.txt'));
from grunt-nodemailer.
Hi!
Your comment did not help me, but still get a hint to me where to go.. But I could not get anything of it
Best case which get some info is next
attachments: [{
filePath: __dirname + grunt.file.expand(grunt.config.get('vars.dest') + '*')[0]
}]
In the log there is next line
Running "nodemailer:send" (nodemailer) task
[D] Task source: /home/vv/work/own/js/uos/ads/node_modules/grunt-nodemailer/tasks/nodemailer.js
Verifying property nodemailer.send exists in config...OK
File: [no files]
Options: transport={"type":"SMTP","options":{"service":"Gmail","auth":{"user":"[email protected]","pass":"..."}}}, message={"from":"...","to":"...","cc":"","bcc":"","subject":"ads: new developer build","text":"\n\nEmail sent by ASH robat v2.","attachments":[{"filePath":"/home/vv/work/own/js/uos/adsundefined"}]}, recipients=[], from="", subject="", html="", text=""
Sending 1 e-mail to recipients: ...
Message sent successfully.
Its obvious that second part of filepath value is 'broken'. All examples that I found in the internet is using static pathes (or hardcoded; same as you btw). I am sending with help of grunt file that has dynamic name. Today this is build/output/ads.dev.master-61.ajs
and tomorrow that will be build/output/ads.dev.master-62.ajs
for example.
I tried different cases and it looks like that grunt's config (and its values respectively) becomes unavailable at some level.
Hope you will give me one more hint because I am out of ideas..
from grunt-nodemailer.
Just for the record I was able to get this working with next line
7 grunt.config('nodemailer.options.message.attachments',
6 [{filePath: grunt.file.expand(grunt.config('vars.dest') + '*')[0]}]);
from grunt-nodemailer.
Related Issues (15)
- Fatal error when trying to send html email HOT 2
- Invalid external files should fail gracefully HOT 2
- Image attachment has no data HOT 2
- Using "sendmail" transport resulting in "spawn sendmail ENOENT" error HOT 1
- False positive when running nodemailer grunt task
- Doesn't work with Sendgrid transport
- Fatal error: Error occured: connect ECONNREFUSED 127.0.0.1:25 HOT 9
- Can't configure for Office365
- Display error name instead of error message HOT 1
- Can't send an attachment via Node-Mailer? HOT 15
- Updating nodemailer to v1.0+ HOT 1
- Fatal error: Error occured: spawn ENOENT HOT 1
- Overwrite subject? HOT 1
- Could you please give a very simple example? HOT 2
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 grunt-nodemailer.