Skip to content

Commit

Permalink
Merge pull request #30 from hubot-archive/use-official-library
Browse files Browse the repository at this point in the history
Use official `@mailchimp/mailchimp_marketing` library
  • Loading branch information
stephenyeargin authored Jul 31, 2023
2 parents 2c7babd + a99cbd5 commit bc3d1f9
Show file tree
Hide file tree
Showing 12 changed files with 2,542 additions and 998 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
},
extends: 'airbnb-base',
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
},
rules: {
},
};
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Then add `hubot-mailchimp` to your `external-scripts.json`:

## Configuration

| Configuration Variable | Required | Description |
| ----------------------------- | -------- | --------------------------------- |
| `MAILCHIMP_API_KEY` | **Yes** | API key for your Hubot integration. |
| `MAILCHIMP_LIST_ID` | **Yes** | The unique identifier for the desired list. |
| Configuration Variable | Required | Description |
| ------------------------- | -------- | ------------------------------------------ |
| `MAILCHIMP_API_KEY` | **Yes** | API key for your Hubot integration |
| `MAILCHIMP_LIST_ID` | **Yes** | The unique identifier for the desired list |
| `MAILCHIMP_SERVER_PREFIX` | **Yes** | Server identifier, e.g. `us10` |

## Sample Interaction

Expand Down
12 changes: 0 additions & 12 deletions index.coffee

This file was deleted.

21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require('fs');
const path = require('path');

module.exports = function (robot, scripts) {
const scriptsPath = path.resolve(__dirname, 'src');
if (fs.existsSync(scriptsPath)) {
return (() => {
const result = [];
for (const script of Array.from(fs.readdirSync(scriptsPath).sort())) {
if ((scripts != null) && !Array.from(scripts).includes('*')) {
if (Array.from(scripts).includes(script)) { result.push(robot.loadFile(scriptsPath, script)); } else {
result.push(undefined);
}
} else {
result.push(robot.loadFile(scriptsPath, script));
}
}
return result;
})();
}
};
Loading

0 comments on commit bc3d1f9

Please sign in to comment.