Skip to content

Commit f6fb04e

Browse files
Add auto-optout Message Handler to ngpvan-optout requirments
1 parent 8b60a9f commit f6fb04e

File tree

1 file changed

+8
-6
lines changed
  • src/extensions/message-handlers/ngpvan-optout

1 file changed

+8
-6
lines changed

src/extensions/message-handlers/ngpvan-optout/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { hasConfig } from "../../../server/api/lib/config";
1+
import { hasConfig, getConfig } from "../../../server/api/lib/config";
22
const Van = require("../../../extensions/action-handlers/ngpvan-action");
33

44
export const serverAdministratorInstructions = () => {
@@ -8,19 +8,21 @@ export const serverAdministratorInstructions = () => {
88
if and only if the internal Spoke auto-optout triggers.
99
`,
1010
setupInstructions: `
11-
This message handler is dependent on the ngpvan-action Action Handler.
12-
Follow it's setup instructions.
13-
Additionally, "ngpvan-optout" must be adde dot the message handler
11+
This message handler is dependent on the ngpvan-action Action Handler,
12+
and the auto-optout Message Handler.
13+
Follow their setup instructions.
14+
Additionally, "ngpvan-optout" must be added to the message handler
1415
environment variable.
1516
`,
1617
environmentVariables: []
1718
};
1819
}
1920

2021
export const available = organization =>
21-
(hasConfig("NGP_VAN_API_KEY", organization) ||
22+
(hasConfig("NGP_VAN_API_KEY", organization) ||
2223
hasConfig("NGP_VAN_API_KEY_ENCRYPTED", organization)) &&
23-
hasConfig("NGP_VAN_APP_NAME", organization);
24+
hasConfig("NGP_VAN_APP_NAME", organization) &&
25+
getConfig("MESSAGE_HANDLER").inlcudes("auto-optout");
2426
//
2527

2628
/* Sends a request to VAN to place an opt out tag to an individual.

0 commit comments

Comments
 (0)