{"action":"created","issue":{"url":"https://api.github.com/repos/niftylettuce/email-templates/issues/356","repository_url":"https://api.github.com/repos/niftylettuce/email-templates","labels_url":"https://api.github.com/repos/niftylettuce/email-templates/issues/356/labels{/name}","comments_url":"https://api.github.com/repos/niftylettuce/email-templates/issues/356/comments","events_url":"https://api.github.com/repos/niftylettuce/email-templates/issues/356/events","html_url":"https://github.com/niftylettuce/email-templates/issues/356","id":431591155,"node_id":"MDU6SXNzdWU0MzE1OTExNTU=","number":356,"title":"The mail is sent on both Windows and Linux, but templates is working only on Windows.","user":{"login":"llagerlof","id":193798,"node_id":"MDQ6VXNlcjE5Mzc5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/193798?v=4","gravatar_id":"","url":"https://api.github.com/users/llagerlof","html_url":"https://github.com/llagerlof","followers_url":"https://api.github.com/users/llagerlof/followers","following_url":"https://api.github.com/users/llagerlof/following{/other_user}","gists_url":"https://api.github.com/users/llagerlof/gists{/gist_id}","starred_url":"https://api.github.com/users/llagerlof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llagerlof/subscriptions","organizations_url":"https://api.github.com/users/llagerlof/orgs","repos_url":"https://api.github.com/users/llagerlof/repos","events_url":"https://api.github.com/users/llagerlof/events{/privacy}","received_events_url":"https://api.github.com/users/llagerlof/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2019-04-10T16:11:52Z","updated_at":"2019-04-10T17:35:14Z","closed_at":null,"author_association":"NONE","body":"Hi devs. I am having a problem with templates.\r\n\r\n```\r\nemail-templates version: 5.0.4\r\nnode version on Windows: 10.15.1\r\nnode version on Linux: 8.10.0\r\nOS: Windows 10 and Linux (Ubuntu)\r\n```\r\n\r\n**The problem:**\r\n\r\nThe body and subject templates is working on Windows. On Linux is being ignored.\r\n\r\n**The situation:**\r\n\r\nMy script `sendmymail.js` send emails using one body's template and one subject's template. The directory structure is exactly like below:\r\n```\r\n/script/sendmymail.js\r\n/script/emails/send_ok/html.pug\r\n/script/emails/send_ok/subject.pug\r\n```\r\n\r\n**Instantiate the mail with smtp, etc. This authenticate succefully with my smtp server (but I changed the authentication data for this issue purpose):**\r\n```lang=js\r\n  const email = new Email({\r\n    message: {\r\n      from: 'a_valid_sender@email.com'\r\n    },\r\n    send: true,\r\n    transport: {\r\n    host: \"smtp.email.com\",\r\n    port: 587,\r\n    secure: false,\r\n    auth: {\r\n      user: \"a_valid_sender\",\r\n      pass: \"the_mail_server_password\"\r\n    }\r\n    }\r\n  });\r\n```\r\n\r\n**The send method:**\r\n```\r\n  email\r\n    .send({\r\n      template: 'send_ok',\r\n      message: {\r\n        to: 'myemail@email.com'\r\n      },\r\n      locals: {\r\n        data: 'test data',\r\n      }\r\n    })\r\n    .then(sentMailSuccess)\r\n    .catch(console.error);\r\n}\r\n```\r\n\r\n**html.pug**\r\n```\r\np This is the body of #{data}.\r\n```\r\n\r\n**subject.pug**\r\n```\r\n= `This is the subject of ${data}`\r\n```\r\n\r\nWhen I run `node sendmymail.js` on **Windows**, the e-mail is sent succefully (the recipient receives the email), with the correct body and subject.\r\n\r\nWhen I run `node sendmymail.js` on **Linux**, the e-mail is sent succefully too (the recipient receives the email), but with an **empty body and subject**.\r\n\r\n**Just a note:** I already checked the directories permission. The owner of all files and directories is the same user who runs the node command, with all the read/write permission set.\r\n\r\nAny ideas what could be happening? Thank you."},"comment":{"url":"https://api.github.com/repos/niftylettuce/email-templates/issues/comments/481788258","html_url":"https://github.com/niftylettuce/email-templates/issues/356#issuecomment-481788258","issue_url":"https://api.github.com/repos/niftylettuce/email-templates/issues/356","id":481788258,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4MTc4ODI1OA==","user":{"login":"llagerlof","id":193798,"node_id":"MDQ6VXNlcjE5Mzc5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/193798?v=4","gravatar_id":"","url":"https://api.github.com/users/llagerlof","html_url":"https://github.com/llagerlof","followers_url":"https://api.github.com/users/llagerlof/followers","following_url":"https://api.github.com/users/llagerlof/following{/other_user}","gists_url":"https://api.github.com/users/llagerlof/gists{/gist_id}","starred_url":"https://api.github.com/users/llagerlof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llagerlof/subscriptions","organizations_url":"https://api.github.com/users/llagerlof/orgs","repos_url":"https://api.github.com/users/llagerlof/repos","events_url":"https://api.github.com/users/llagerlof/events{/privacy}","received_events_url":"https://api.github.com/users/llagerlof/received_events","type":"User","site_admin":false},"created_at":"2019-04-10T17:35:13Z","updated_at":"2019-04-10T17:35:13Z","author_association":"NONE","body":"I am sending using SMTP.\r\n\r\nThe transport I am using is the embedded email-templates' nodemailer. And the setup I am using is just as described below (I changed the credentials and the SMTP address):\r\n```\r\n  const email = new Email({\r\n    message: {\r\n      from: 'a_valid_sender@email.com'\r\n    },\r\n    send: true,\r\n    transport: {\r\n    host: \"smtp.email.com\",\r\n    port: 587,\r\n    secure: false,\r\n    auth: {\r\n      user: \"a_valid_sender\",\r\n      pass: \"the_mail_server_password\"\r\n    }\r\n    }\r\n  });\r\n```\r\n\r\nMaybe this is related to Issue #348 ?"}}
{"actor":{"display_login":"llagerlof"}}