diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index a918c9edf7..b5778e1491 100755 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-email-amazon-ses/.editorconfig b/packages/strapi-email-amazon-ses/.editorconfig new file mode 100644 index 0000000000..473e45184b --- /dev/null +++ b/packages/strapi-email-amazon-ses/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[{package.json,*.yml}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/strapi-email-amazon-ses/.gitignore b/packages/strapi-email-amazon-ses/.gitignore new file mode 100644 index 0000000000..ab74240ce1 --- /dev/null +++ b/packages/strapi-email-amazon-ses/.gitignore @@ -0,0 +1,96 @@ +############################ +# OS X +############################ + +.DS_Store +.AppleDouble +.LSOverride +Icon +.Spotlight-V100 +.Trashes +._* + + +############################ +# Linux +############################ + +*~ + + +############################ +# Windows +############################ + +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ +*.cab +*.msi +*.msm +*.msp + + +############################ +# Packages +############################ + +*.7z +*.csv +*.dat +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip +*.com +*.class +*.dll +*.exe +*.o +*.seed +*.so +*.swo +*.swp +*.swn +*.swm +*.out +*.pid + + +############################ +# Logs and databases +############################ + +.tmp +*.log +*.sql +*.sqlite + + +############################ +# Misc. +############################ + +*# +.idea +nbproject + + +############################ +# Node.js +############################ + +lib-cov +lcov.info +pids +logs +results +build +node_modules +.node_history +package-lock.json +yarn.lock diff --git a/packages/strapi-email-amazon-ses/.npmignore b/packages/strapi-email-amazon-ses/.npmignore new file mode 100644 index 0000000000..af4e0054dd --- /dev/null +++ b/packages/strapi-email-amazon-ses/.npmignore @@ -0,0 +1,104 @@ +############################ +# OS X +############################ + +.DS_Store +.AppleDouble +.LSOverride +Icon +.Spotlight-V100 +.Trashes +._* + + +############################ +# Linux +############################ + +*~ + + +############################ +# Windows +############################ + +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ +*.cab +*.msi +*.msm +*.msp + + +############################ +# Packages +############################ + +*.7z +*.csv +*.dat +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip +*.com +*.class +*.dll +*.exe +*.o +*.seed +*.so +*.swo +*.swp +*.swn +*.swm +*.out +*.pid + + +############################ +# Logs and databases +############################ + +.tmp +*.log +*.sql +*.sqlite + + +############################ +# Misc. +############################ + +*# +ssl +.editorconfig +.gitattributes +.idea +nbproject + + +############################ +# Node.js +############################ + +lib-cov +lcov.info +pids +logs +results +build +node_modules +.node_history + + +############################ +# Tests +############################ + +test diff --git a/packages/strapi-email-amazon-ses/LICENSE.md b/packages/strapi-email-amazon-ses/LICENSE.md new file mode 100644 index 0000000000..6865b7e33f --- /dev/null +++ b/packages/strapi-email-amazon-ses/LICENSE.md @@ -0,0 +1,7 @@ +Copyright (c) 2018 Nikolay Tsenkov (nikolay@tsenkov.net). + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/strapi-email-amazon-ses/README.md b/packages/strapi-email-amazon-ses/README.md new file mode 100644 index 0000000000..b6c41e6f2e --- /dev/null +++ b/packages/strapi-email-amazon-ses/README.md @@ -0,0 +1,11 @@ +# strapi-email-amazon-ses + +## Resources + +- [MIT License](LICENSE.md) + +## Links + +- [Strapi website](http://strapi.io/) +- [Strapi community on Slack](http://slack.strapi.io) +- [Strapi news on Twitter](https://twitter.com/strapijs) diff --git a/packages/strapi-email-amazon-ses/lib/index.js b/packages/strapi-email-amazon-ses/lib/index.js new file mode 100644 index 0000000000..5b0532820a --- /dev/null +++ b/packages/strapi-email-amazon-ses/lib/index.js @@ -0,0 +1,73 @@ +'use strict'; + +/** + * Module dependencies + */ + +/* eslint-disable import/no-unresolved */ +/* eslint-disable prefer-template */ +// Public node modules. +const _ = require('lodash'); +const nodeSES = require('node-ses'); + +/* eslint-disable no-unused-vars */ +module.exports = { + provider: 'amazon-ses', + name: 'Amazon SES', + auth: { + amazon_ses_default_from: { + label: 'Default From', + type: 'text' + }, + amazon_ses_default_replyto: { + label: 'Default Reply-To', + type: 'text' + }, + amazon_ses_api_key: { + label: 'Amazon Access key ID', + type: 'text' + }, + amazon_ses_secret: { + label: 'Amazon Secret access key', + type: 'text' + } + }, + + init: (config) => { + + var client = nodeSES.createClient({ + key: config.amazon_ses_api_key, + secret: config.amazon_ses_secret + }); + + return { + send: (options, cb) => { + return new Promise((resolve, reject) => { + // Default values. + options = _.isObject(options) ? options : {}; + options.from = options.from || config.amazon_ses_default_from; + options.replyTo = options.replyTo || config.amazon_ses_default_replyto; + options.text = options.text || options.html; + options.html = options.html || options.text; + + let msg = { + from: options.from, + to: options.to, + replyTo: options.replyTo, + subject: options.subject, + altText: options.text, + message: options.html + }; + + client.sendEmail(msg, function (err) { + if (err) { + reject([{ messages: [{ id: 'Auth.form.error.email.invalid' }] }]); + } else { + resolve(); + } + }); + }); + } + }; + } +}; diff --git a/packages/strapi-email-amazon-ses/package.json b/packages/strapi-email-amazon-ses/package.json new file mode 100644 index 0000000000..74c181aa1c --- /dev/null +++ b/packages/strapi-email-amazon-ses/package.json @@ -0,0 +1,45 @@ +{ + "name": "strapi-email-amazon-ses", + "version": "3.0.0-alpha.13", + "description": "Amazon SES provider for strapi email", + "homepage": "http://strapi.io", + "keywords": [ + "email", + "strapi", + "amazon", + "ses" + ], + "directories": { + "lib": "./lib" + }, + "main": "./lib", + "dependencies": { + "node-ses": "^2.1.0" + }, + "strapi": { + "isProvider": true + }, + "author": { + "email": "nikolay@tsenkov.net", + "name": "Nikolay tsenkov" + }, + "maintainers": [ + { + "name": "Strapi team", + "email": "hi@strapi.io", + "url": "http://strapi.io" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/strapi/strapi.git" + }, + "bugs": { + "url": "https://github.com/strapi/strapi/issues" + }, + "engines": { + "node": ">= 9.0.0", + "npm": ">= 5.3.0" + }, + "license": "MIT" +} diff --git a/packages/strapi-email-mailgun/package.json b/packages/strapi-email-mailgun/package.json index c59e63d4ab..965da84429 100644 --- a/packages/strapi-email-mailgun/package.json +++ b/packages/strapi-email-mailgun/package.json @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-email-sendgrid/package.json b/packages/strapi-email-sendgrid/package.json index c9f50abcee..b48fca45ca 100644 --- a/packages/strapi-email-sendgrid/package.json +++ b/packages/strapi-email-sendgrid/package.json @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-email-sendmail/package.json b/packages/strapi-email-sendmail/package.json index fa046d68f2..10ae86a7bf 100644 --- a/packages/strapi-email-sendmail/package.json +++ b/packages/strapi-email-sendmail/package.json @@ -41,4 +41,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate-admin/package.json b/packages/strapi-generate-admin/package.json index eb031e75d9..310ebd1133 100755 --- a/packages/strapi-generate-admin/package.json +++ b/packages/strapi-generate-admin/package.json @@ -42,4 +42,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index ecdd5c347e..6b7b2256d8 100755 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index 3a0519748f..3ecea9c62b 100755 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -115,4 +115,4 @@ "webpack-hot-middleware": "^2.18.2", "whatwg-fetch": "^2.0.3" } -} \ No newline at end of file +} diff --git a/packages/strapi-hook-knex/package.json b/packages/strapi-hook-knex/package.json index c327e2f0bd..fabc2d9d20 100755 --- a/packages/strapi-hook-knex/package.json +++ b/packages/strapi-hook-knex/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-hook-mongoose/package.json b/packages/strapi-hook-mongoose/package.json index e6855a3f8d..d823b8028d 100755 --- a/packages/strapi-hook-mongoose/package.json +++ b/packages/strapi-hook-mongoose/package.json @@ -45,4 +45,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index dc332efa68..dece5c74e3 100755 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -44,4 +44,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-lint/package.json b/packages/strapi-lint/package.json index 2eb9b99121..1500b98b5e 100644 --- a/packages/strapi-lint/package.json +++ b/packages/strapi-lint/package.json @@ -41,4 +41,4 @@ "babel-eslint": "^8.2.3", "prettier": "^1.12.1" } -} \ No newline at end of file +} diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index 7021e73eab..f1fdf961bf 100755 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index 39cdc52f5b..ab90424597 100755 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -51,4 +51,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index 727a8d695c..e42053448f 100755 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -50,4 +50,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-email/package.json b/packages/strapi-plugin-email/package.json index 20cab4dc6d..4edf64ed57 100644 --- a/packages/strapi-plugin-email/package.json +++ b/packages/strapi-plugin-email/package.json @@ -49,4 +49,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 482d315d9f..361dd4a40d 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -49,4 +49,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-settings-manager/package.json b/packages/strapi-plugin-settings-manager/package.json index 33763835d5..c6175c5788 100755 --- a/packages/strapi-plugin-settings-manager/package.json +++ b/packages/strapi-plugin-settings-manager/package.json @@ -48,4 +48,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index 46c67b8057..45e483ab51 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -47,4 +47,4 @@ "npm": ">= 3.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index 49a6cc2b7e..b0979300df 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -54,4 +54,4 @@ "npm": ">= 5.0.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-upload-aws-s3/package.json b/packages/strapi-upload-aws-s3/package.json index 2888b061bf..2296da7660 100644 --- a/packages/strapi-upload-aws-s3/package.json +++ b/packages/strapi-upload-aws-s3/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-upload-cloudinary/package.json b/packages/strapi-upload-cloudinary/package.json index 5c92874574..7cf5eff3f2 100644 --- a/packages/strapi-upload-cloudinary/package.json +++ b/packages/strapi-upload-cloudinary/package.json @@ -43,4 +43,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-upload-local/package.json b/packages/strapi-upload-local/package.json index 979b53e868..153f0a7c03 100644 --- a/packages/strapi-upload-local/package.json +++ b/packages/strapi-upload-local/package.json @@ -39,4 +39,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi-upload-rackspace/package.json b/packages/strapi-upload-rackspace/package.json index a0e60d2516..173b67a7ea 100644 --- a/packages/strapi-upload-rackspace/package.json +++ b/packages/strapi-upload-rackspace/package.json @@ -13,4 +13,4 @@ "pkgcloud": "^1.5.0", "streamifier": "^0.1.1" } -} \ No newline at end of file +} diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index 0c4a7ef156..50b33deb51 100755 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -49,4 +49,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/packages/strapi/package.json b/packages/strapi/package.json index 2d7645d505..df76357a9b 100755 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -91,4 +91,4 @@ }, "preferGlobal": true, "license": "MIT" -} \ No newline at end of file +}