├── .github └── workflows │ └── release.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENCE ├── PATENTS ├── README.md ├── index.js ├── package-lock.json └── package.json /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | publish-npm: 7 | runs-on: ubuntu-18.04 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: actions/setup-node@v1 11 | with: 12 | node-version: '10.14' 13 | registry-url: https://registry.npmjs.org/ 14 | - name: Cache Node.js modules 15 | uses: actions/cache@v2 16 | with: 17 | path: ~/.npm 18 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 19 | restore-keys: | 20 | ${{ runner.os }}-node- 21 | - run: npm ci 22 | - run: npm publish 23 | env: 24 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.0.0 4 | ## Breaking Changes 5 | - Upgraded to new native `mailgun.js` driver that does support the same options as the deprecated driver, see [docs](https://github.com/mailgun/mailgun-js#readme) (Manuel Trezza) [#37](https://github.com/parse-community/parse-server-simple-mailgun-adapter/pull/37) 6 | ## Notable Changes 7 | (none) 8 | ## Other Changes 9 | (none) -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at codeofconduct@parseplatform.org. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For Parse Server software 4 | 5 | Copyright (c) 2015-present, Parse, LLC. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Parse nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | ----- 33 | 34 | As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code. 35 | -------------------------------------------------------------------------------- /PATENTS: -------------------------------------------------------------------------------- 1 | Additional Grant of Patent Rights Version 2 2 | 3 | "Software" means the Parse Server software distributed by Parse, LLC. 4 | 5 | Parse, LLC. ("Parse") hereby grants to each recipient of the Software 6 | ("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable 7 | (subject to the termination provision below) license under any Necessary 8 | Claims, to make, have made, use, sell, offer to sell, import, and otherwise 9 | transfer the Software. For avoidance of doubt, no license is granted under 10 | Parse’s rights in any patent claims that are infringed by (i) modifications 11 | to the Software made by you or any third party or (ii) the Software in 12 | combination with any software or other technology. 13 | 14 | The license granted hereunder will terminate, automatically and without notice, 15 | if you (or any of your subsidiaries, corporate affiliates or agents) initiate 16 | directly or indirectly, or take a direct financial interest in, any Patent 17 | Assertion: (i) against Parse or any of its subsidiaries or corporate 18 | affiliates, (ii) against any party if such Patent Assertion arises in whole or 19 | in part from any software, technology, product or service of Parse or any of 20 | its subsidiaries or corporate affiliates, or (iii) against any party relating 21 | to the Software. Notwithstanding the foregoing, if Parse or any of its 22 | subsidiaries or corporate affiliates files a lawsuit alleging patent 23 | infringement against you in the first instance, and you respond by filing a 24 | patent infringement counterclaim in that lawsuit against that party that is 25 | unrelated to the Software, the license granted hereunder will not terminate 26 | under section (i) of this paragraph due to such counterclaim. 27 | 28 | A "Necessary Claim" is a claim of a patent owned by Parse that is 29 | necessarily infringed by the Software standing alone. 30 | 31 | A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, 32 | or contributory infringement or inducement to infringe any patent, including a 33 | cross-claim or counterclaim. 34 | 35 | ----- 36 | 37 | As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code. 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | This mail adapter has been deprecated. Instead, use one of the [community provided mail adapters](https://github.com/parse-community/parse-server#email-verification-and-password-reset). 4 | 5 | --- 6 | # Parse Server Simple Mailgun Adapter 7 | 8 | npm version 9 | 10 | Used to send Parse Server password reset and email verification emails though Mailgun 11 | 12 | ## Installation 13 | 14 | `npm install --save @parse/simple-mailgun-adapter` 15 | 16 | 17 | ----- 18 | 19 | As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code. 20 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | const Mailgun = require('mailgun.js'); 3 | 4 | const SimpleMailgunAdapter = mailgunOptions => { 5 | if (!mailgunOptions || !mailgunOptions.apiKey || !mailgunOptions.domain || !mailgunOptions.fromAddress) { 6 | throw 'SimpleMailgunAdapter requires an API Key, domain, and fromAddress.'; 7 | } 8 | const mailgunClient = Mailgun.client({ 9 | username: 'api', 10 | key: mailgunOptions.apiKey 11 | }); 12 | 13 | const sendMail = mail => { 14 | const data = Object.assign({}, mail, { from: mailgunOptions.fromAddress }); 15 | return mailgunClient.messages.create(mailgunOptions.domain, data); 16 | } 17 | 18 | return Object.freeze({ 19 | sendMail: sendMail 20 | }); 21 | } 22 | 23 | module.exports = SimpleMailgunAdapter 24 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@parse/simple-mailgun-adapter", 3 | "version": "1.2.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "abort-controller": { 8 | "version": "3.0.0", 9 | "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", 10 | "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", 11 | "requires": { 12 | "event-target-shim": "^5.0.0" 13 | } 14 | }, 15 | "bluebird": { 16 | "version": "3.7.2", 17 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", 18 | "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" 19 | }, 20 | "btoa": { 21 | "version": "1.2.1", 22 | "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", 23 | "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==" 24 | }, 25 | "clone-deep": { 26 | "version": "4.0.1", 27 | "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", 28 | "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", 29 | "requires": { 30 | "is-plain-object": "^2.0.4", 31 | "kind-of": "^6.0.2", 32 | "shallow-clone": "^3.0.0" 33 | } 34 | }, 35 | "event-target-shim": { 36 | "version": "5.0.1", 37 | "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", 38 | "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" 39 | }, 40 | "fetch-blob": { 41 | "version": "2.1.1", 42 | "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-2.1.1.tgz", 43 | "integrity": "sha512-Uf+gxPCe1hTOFXwkxYyckn8iUSk6CFXGy5VENZKifovUTZC9eUODWSBhOBS7zICGrAetKzdwLMr85KhIcePMAQ==" 44 | }, 45 | "is-plain-object": { 46 | "version": "2.0.4", 47 | "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", 48 | "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", 49 | "requires": { 50 | "isobject": "^3.0.1" 51 | } 52 | }, 53 | "isobject": { 54 | "version": "3.0.1", 55 | "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", 56 | "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" 57 | }, 58 | "kind-of": { 59 | "version": "6.0.3", 60 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", 61 | "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" 62 | }, 63 | "ky": { 64 | "version": "0.25.1", 65 | "resolved": "https://registry.npmjs.org/ky/-/ky-0.25.1.tgz", 66 | "integrity": "sha512-PjpCEWlIU7VpiMVrTwssahkYXX1by6NCT0fhTUX34F3DTinARlgMpriuroolugFPcMgpPWrOW4mTb984Qm1RXA==" 67 | }, 68 | "ky-universal": { 69 | "version": "0.8.2", 70 | "resolved": "https://registry.npmjs.org/ky-universal/-/ky-universal-0.8.2.tgz", 71 | "integrity": "sha512-xe0JaOH9QeYxdyGLnzUOVGK4Z6FGvDVzcXFTdrYA1f33MZdEa45sUDaMBy98xQMcsd2XIBrTXRrRYnegcSdgVQ==", 72 | "requires": { 73 | "abort-controller": "^3.0.0", 74 | "node-fetch": "3.0.0-beta.9" 75 | } 76 | }, 77 | "lodash.defaults": { 78 | "version": "4.2.0", 79 | "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", 80 | "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" 81 | }, 82 | "lodash.keyby": { 83 | "version": "4.6.0", 84 | "resolved": "https://registry.npmjs.org/lodash.keyby/-/lodash.keyby-4.6.0.tgz", 85 | "integrity": "sha1-f2oavak/0k4icopNNh7YvLpaQ1Q=" 86 | }, 87 | "lodash.map": { 88 | "version": "4.6.0", 89 | "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", 90 | "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" 91 | }, 92 | "lodash.partialright": { 93 | "version": "4.2.1", 94 | "resolved": "https://registry.npmjs.org/lodash.partialright/-/lodash.partialright-4.2.1.tgz", 95 | "integrity": "sha1-ATDYDoM2MmTUAHTzKbij56ihzEs=" 96 | }, 97 | "mailgun.js": { 98 | "version": "3.2.1", 99 | "resolved": "https://registry.npmjs.org/mailgun.js/-/mailgun.js-3.2.1.tgz", 100 | "integrity": "sha512-CWJrfkjA4aFaIBW9Swm7hU1KJxSZ46UERFvo06gF806Hd6tzrLsfqSnDVxg4q98u4Tu4oy2YXo9i4V2+lH5jVQ==", 101 | "requires": { 102 | "bluebird": "^3.7.2", 103 | "btoa": "^1.1.2", 104 | "ky": "^0.25.1", 105 | "ky-universal": "^0.8.2", 106 | "lodash.defaults": "^4.2.0", 107 | "lodash.keyby": "^4.6.0", 108 | "lodash.map": "^4.6.0", 109 | "lodash.partialright": "^4.2.1", 110 | "url": "^0.11.0", 111 | "url-join": "0.0.1", 112 | "web-streams-polyfill": "^3.0.1", 113 | "webpack-merge": "^5.4.0" 114 | } 115 | }, 116 | "node-fetch": { 117 | "version": "3.0.0-beta.9", 118 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0-beta.9.tgz", 119 | "integrity": "sha512-RdbZCEynH2tH46+tj0ua9caUHVWrd/RHnRfvly2EVdqGmI3ndS1Vn/xjm5KuGejDt2RNDQsVRLPNd2QPwcewVg==", 120 | "requires": { 121 | "data-uri-to-buffer": "^3.0.1", 122 | "fetch-blob": "^2.1.1" 123 | }, 124 | "dependencies": { 125 | "data-uri-to-buffer": { 126 | "version": "3.0.1", 127 | "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", 128 | "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==" 129 | } 130 | } 131 | }, 132 | "punycode": { 133 | "version": "1.3.2", 134 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 135 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" 136 | }, 137 | "querystring": { 138 | "version": "0.2.0", 139 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 140 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" 141 | }, 142 | "shallow-clone": { 143 | "version": "3.0.1", 144 | "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", 145 | "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", 146 | "requires": { 147 | "kind-of": "^6.0.2" 148 | } 149 | }, 150 | "url": { 151 | "version": "0.11.0", 152 | "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", 153 | "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", 154 | "requires": { 155 | "punycode": "1.3.2", 156 | "querystring": "0.2.0" 157 | } 158 | }, 159 | "url-join": { 160 | "version": "0.0.1", 161 | "resolved": "https://registry.npmjs.org/url-join/-/url-join-0.0.1.tgz", 162 | "integrity": "sha1-HbSK1CLTQCRpqH99l73r/k+x48g=" 163 | }, 164 | "web-streams-polyfill": { 165 | "version": "3.0.2", 166 | "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.0.2.tgz", 167 | "integrity": "sha512-JTNkNbAKoSo8NKiqu2UUaqRFCDWWZaCOsXuJEsToWopikTA0YHKKUf91GNkS/SnD8JixOkJjVsiacNlrFnRECA==" 168 | }, 169 | "webpack-merge": { 170 | "version": "5.7.3", 171 | "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", 172 | "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", 173 | "requires": { 174 | "clone-deep": "^4.0.1", 175 | "wildcard": "^2.0.0" 176 | } 177 | }, 178 | "wildcard": { 179 | "version": "2.0.0", 180 | "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", 181 | "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==" 182 | } 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@parse/simple-mailgun-adapter", 3 | "version": "2.0.0", 4 | "description": "Used to send Parse Server password reset and email verification emails though Mailgun", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/parse-community/parse-server-simple-mailgun-adapter.git" 12 | }, 13 | "keywords": [ 14 | "parse", 15 | "parse-server", 16 | "email-adapter" 17 | ], 18 | "author": "Drew Gross", 19 | "license": "BSD-3-Clause", 20 | "bugs": { 21 | "url": "https://github.com/parse-community/parse-server-simple-mailgun-adapter/issues" 22 | }, 23 | "homepage": "https://github.com/parse-community/parse-server-simple-mailgun-adapter#readme", 24 | "dependencies": { 25 | "mailgun.js": "3.2.1" 26 | } 27 | } 28 | --------------------------------------------------------------------------------