From a82e9aa3c505a962d9cad60d632759188f83ae1d Mon Sep 17 00:00:00 2001 From: Sebastian Gierlinger Date: Wed, 12 Aug 2015 10:24:34 +0200 Subject: [PATCH] Mail consolidation refs #5489 - move mail.js -> mail/index.js - move email-templates -> mail/templates --- .npmignore | 2 +- core/server/api/mail.js | 4 ++-- core/server/{mail.js => mail/index.js} | 2 +- .../{email-templates => mail/templates}/invite-user.html | 0 .../{email-templates => mail/templates}/raw/invite-user.html | 0 .../templates}/raw/reset-password.html | 0 core/server/{email-templates => mail/templates}/raw/test.html | 0 .../{email-templates => mail/templates}/raw/welcome.html | 0 .../{email-templates => mail/templates}/reset-password.html | 0 core/server/{email-templates => mail/templates}/test.html | 0 core/server/{email-templates => mail/templates}/welcome.html | 0 11 files changed, 4 insertions(+), 4 deletions(-) rename core/server/{mail.js => mail/index.js} (99%) rename core/server/{email-templates => mail/templates}/invite-user.html (100%) rename core/server/{email-templates => mail/templates}/raw/invite-user.html (100%) rename core/server/{email-templates => mail/templates}/raw/reset-password.html (100%) rename core/server/{email-templates => mail/templates}/raw/test.html (100%) rename core/server/{email-templates => mail/templates}/raw/welcome.html (100%) rename core/server/{email-templates => mail/templates}/reset-password.html (100%) rename core/server/{email-templates => mail/templates}/test.html (100%) rename core/server/{email-templates => mail/templates}/welcome.html (100%) diff --git a/.npmignore b/.npmignore index aba865d0d8..4f4ec0ac9c 100644 --- a/.npmignore +++ b/.npmignore @@ -29,6 +29,6 @@ CONTRIBUTING.md SECURITY.md .travis.yml *.html -!core/server/email-templates/** +!core/server/mail/templates/** bower_components/** .editorconfig diff --git a/core/server/api/mail.js b/core/server/api/mail.js index 62a7d08ee4..bfe0ea99d8 100644 --- a/core/server/api/mail.js +++ b/core/server/api/mail.js @@ -9,7 +9,7 @@ var _ = require('lodash').runInContext(), Models = require('../models'), path = require('path'), fs = require('fs'), - templatesDir = path.resolve(__dirname, '..', 'email-templates'), + templatesDir = path.resolve(__dirname, '..', 'mail', 'templates'), htmlToText = require('html-to-text'), mail; @@ -79,7 +79,7 @@ mail = { * * @param {Object} options { * data: JSON object representing the data that will go into the email - * template: which email template to load (files are stored in /core/server/email-templates/) + * template: which email template to load (files are stored in /core/server/mail/templates/) * } * @returns {*} */ diff --git a/core/server/mail.js b/core/server/mail/index.js similarity index 99% rename from core/server/mail.js rename to core/server/mail/index.js index abe3609c14..54270bf6c0 100644 --- a/core/server/mail.js +++ b/core/server/mail/index.js @@ -4,7 +4,7 @@ var _ = require('lodash'), Promise = require('bluebird'), nodemailer = require('nodemailer'), validator = require('validator'), - config = require('./config'); + config = require('../config'); function GhostMailer(opts) { opts = opts || {}; diff --git a/core/server/email-templates/invite-user.html b/core/server/mail/templates/invite-user.html similarity index 100% rename from core/server/email-templates/invite-user.html rename to core/server/mail/templates/invite-user.html diff --git a/core/server/email-templates/raw/invite-user.html b/core/server/mail/templates/raw/invite-user.html similarity index 100% rename from core/server/email-templates/raw/invite-user.html rename to core/server/mail/templates/raw/invite-user.html diff --git a/core/server/email-templates/raw/reset-password.html b/core/server/mail/templates/raw/reset-password.html similarity index 100% rename from core/server/email-templates/raw/reset-password.html rename to core/server/mail/templates/raw/reset-password.html diff --git a/core/server/email-templates/raw/test.html b/core/server/mail/templates/raw/test.html similarity index 100% rename from core/server/email-templates/raw/test.html rename to core/server/mail/templates/raw/test.html diff --git a/core/server/email-templates/raw/welcome.html b/core/server/mail/templates/raw/welcome.html similarity index 100% rename from core/server/email-templates/raw/welcome.html rename to core/server/mail/templates/raw/welcome.html diff --git a/core/server/email-templates/reset-password.html b/core/server/mail/templates/reset-password.html similarity index 100% rename from core/server/email-templates/reset-password.html rename to core/server/mail/templates/reset-password.html diff --git a/core/server/email-templates/test.html b/core/server/mail/templates/test.html similarity index 100% rename from core/server/email-templates/test.html rename to core/server/mail/templates/test.html diff --git a/core/server/email-templates/welcome.html b/core/server/mail/templates/welcome.html similarity index 100% rename from core/server/email-templates/welcome.html rename to core/server/mail/templates/welcome.html