Skip to content

Commit

Permalink
Add auto-optout Message Handler to ngpvan-optout requirments
Browse files Browse the repository at this point in the history
  • Loading branch information
engelhartrueben committed Nov 25, 2024
1 parent 8b60a9f commit f6fb04e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/extensions/message-handlers/ngpvan-optout/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasConfig } from "../../../server/api/lib/config";
import { hasConfig, getConfig } from "../../../server/api/lib/config";
const Van = require("../../../extensions/action-handlers/ngpvan-action");

export const serverAdministratorInstructions = () => {
Expand All @@ -8,19 +8,21 @@ export const serverAdministratorInstructions = () => {
if and only if the internal Spoke auto-optout triggers.
`,
setupInstructions: `
This message handler is dependent on the ngpvan-action Action Handler.
Follow it's setup instructions.
Additionally, "ngpvan-optout" must be adde dot the message handler
This message handler is dependent on the ngpvan-action Action Handler,
and the auto-optout Message Handler.
Follow their setup instructions.
Additionally, "ngpvan-optout" must be added to the message handler
environment variable.
`,
environmentVariables: []
};
}

export const available = organization =>
(hasConfig("NGP_VAN_API_KEY", organization) ||
(hasConfig("NGP_VAN_API_KEY", organization) ||
hasConfig("NGP_VAN_API_KEY_ENCRYPTED", organization)) &&
hasConfig("NGP_VAN_APP_NAME", organization);
hasConfig("NGP_VAN_APP_NAME", organization) &&
getConfig("MESSAGE_HANDLER").inlcudes("auto-optout");
//

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

0 comments on commit f6fb04e

Please sign in to comment.