Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ENOENT: no such file or directory, open 'C:\Dev\undefined\temp\92129402-b28f-42b7-83f2-8e52fc72b2ee.html #388

Closed
KnutHjelvik opened this issue Mar 19, 2020 · 1 comment

Comments

@KnutHjelvik
Copy link

KnutHjelvik commented Mar 19, 2020

Hello

Experimenting abit with this lib. I do want to use it.

Using Windows 10

Node 11.5

Email-Templates 7.0.4

Folder structure:

sendMail.js
emails\registerUserEmail\html.pug
email\registerUserEmail\subject.pug
email\registerUserEmail\text.pug

When process.env is set to development it works. But when set to production it fails.

Getting following error:

{ [Error: ENOENT: no such file or directory, open 'C:\Dev\undefined\temp\92129402-b28f-42b7-83f2-8e52fc72b2ee.html']
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path:
'C:\Dev\undefined\temp\92129402-b28f-42b7-83f2-8e52fc72b2ee.html' }

Any ideas?

Code

let newEmail = require('email-templates');
process.env = 'production'

let email = new newEmail({
    message: {
        from: 'mail@mail.com'
    },
    transport: {
        jsonTransport: true,

    }
});

email.send({
    template: 'registerUserEmail',
    message: {
        to: 'mail@mail.com'
    },
    locals: {
        name: 'Elon'
    }
}).then(console.log).catch(console.log)


@niftylettuce
Copy link
Collaborator

This is an issue on your side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants