Loading...
Loading...
Configure consent (opt-in/opt-out) on an Enhanced `MessagingChannel` so activation will accept it. Given a `{CHANNEL_ID}`, sets the channel's `ConsentType` (ImplicitOptIn / ExplicitOptIn / DoubleOptIn) and the `OptInPrompt` / `DoubleOptInPrompt` prompt fields, then creates or updates one `MsgChannelLanguageKeyword` record per language holding the opt-in / double-opt-in / opt-out / help / custom keywords and confirmation messages. Use between channel insertion and activation — activation fails the consent-readiness check unless a valid ConsentType and at least one matching language-keyword record exist.
npx skill4agent add forcedotcom/sf-skills service-de-channel-consent-configureMessagingChannelMessagingChannelReadinessChecker.isConsentConfiguredForChannelMessagingChannelConsentTypeImplicitOptInExplicitOptInDoubleOptInOptInPromptDoubleOptInPromptIsRequireDoubleOptInConsentType=DoubleOptInMsgChannelLanguageKeywordMessagingChannel3Or"STOP,UNSUBSCRIBE,CANCEL"ImplicitOptInMsgChannelLanguageKeywordPlatformType=Enhancedservice-de-channel-routing-configureSessionHandlerservice-de-channel-activateservice-de-headless-channel-configure| Reference file | Load when |
|---|---|
| Creating or updating the per-language |
| Troubleshooting an unexpected result, or before modifying this skill. |
| You want a reference run of the ImplicitOptIn, ExplicitOptIn, or DoubleOptIn paths. |
PlatformType=EnhancedMessagingChannel.Id{CHANNEL_ID}MessagingChannel.Id0Mj{CONSENT_TYPE}ImplicitOptInExplicitOptInDoubleOptIn{LANGUAGE}MasterLanguageen_USen_US{ORG_ALIAS}sfsf config get target-org{"ok": true, "noop": true, "consentType": "ImplicitOptIn|ExplicitOptIn|DoubleOptIn", "languageKeywordIds": ["3Or..."], "message": "Consent already configured and activation-ready"}{"ok": true, "consentType": "ExplicitOptIn", "channelFieldsSet": ["ConsentType","OptInPrompt"],
"languageKeywordId": "3Or...", "language": "en_US", "created": true|false, "activationReady": true}{"ok": false, "kind": "not-enhanced", "hint": "consent fields apply to Enhanced channels only; this channel is PlatformType=<x>"}
{"ok": false, "kind": "missing-consent-input", "hint": "<which required keyword/prompt for the chosen ConsentType is missing>"}{"ok": false, "kind": "channel-patch-failed", "message": "..."}
{"ok": false, "kind": "keyword-record-failed", "message": "..."}
{"ok": false, "kind": "verify-failed", "hint": "writes returned success but a re-read shows the channel is still not consent-ready"}sf data query --target-org '{ORG_ALIAS}' \
--query "SELECT Id, DeveloperName, PlatformType, MessageType, MessagingPlatformKey, ConsentType, OptInPrompt, DoubleOptInPrompt, IsRequireDoubleOptIn FROM MessagingChannel WHERE Id = '{CHANNEL_ID}'" \
--json > /tmp/cc-channel.json
sf data query --target-org '{ORG_ALIAS}' \
--query "SELECT Id, MasterLanguage, OptInKeywords, DoubleOptInKeywords, OptInConfirmation, OptOutKeywords, OptOutConfirmation, HelpKeywords, HelpResponse, CustomKeywords, CustomResponse FROM MsgChannelLanguageKeyword WHERE MessagingChannelId = '{CHANNEL_ID}'" \
--json > /tmp/cc-keywords.jsonError: Channel {CHANNEL_ID} not found — check the id, or run the insertion skill first.PlatformType != 'Enhanced'{ok:false, kind:"not-enhanced", ...}ConsentTypenoop:true{CONSENT_TYPE}Channel '{developerName}' ({CHANNEL_ID}) — choose a consent model:
1) ImplicitOptIn — end users are opted in by default; you only handle opt-OUT (STOP) keywords.
2) ExplicitOptIn — end users must send an opt-in keyword before you can message them.
3) DoubleOptIn — explicit opt-in plus a second confirming keyword.
Pick [1-3]:{CONSENT_TYPE}references/gotchas.md| ConsentType | MessagingChannel fields | |
|---|---|---|
| ImplicitOptIn | (none required) | |
| ExplicitOptIn | | above + |
| DoubleOptIn | | above + |
OptInPromptMessageType IN ('Text','WhatsApp','Rcs')isUnifiedSMSOrWhatsappOrRCSImplicitOptInExplicitOptInDoubleOptInOpt-in prompt (sent when a reply doesn't match an opt-in keyword):DoubleOptInDouble-opt-in prompt (sent when a reply doesn't match a double-opt-in keyword):{ok:false, kind:"missing-consent-input", hint:"..."}{LANGUAGE}en_USMsgChannelLanguageKeywordreferences/language-keywords.mdOptOutKeywordsSTOP,UNSUBSCRIBEOptOutConfirmationOptInKeywordsSTART,YESDoubleOptInKeywordsCONFIRMOptInConfirmationHelpKeywordsHelpResponseCustomKeywordsCustomResponsesf data update record --values--valuesOptInPrompt='Reply YES to receive messages'OptInPrompt=Reply YES ...Malformed key=value pair# ImplicitOptIn — ConsentType only
sf data update record --target-org '{ORG_ALIAS}' --sobject MessagingChannel \
--record-id '{CHANNEL_ID}' --values "ConsentType=ImplicitOptIn" --json > /tmp/cc-patch.json
# ExplicitOptIn
sf data update record --target-org '{ORG_ALIAS}' --sobject MessagingChannel \
--record-id '{CHANNEL_ID}' --values "ConsentType=ExplicitOptIn OptInPrompt='{OPT_IN_PROMPT}'" --json > /tmp/cc-patch.json
# DoubleOptIn
sf data update record --target-org '{ORG_ALIAS}' --sobject MessagingChannel \
--record-id '{CHANNEL_ID}' \
--values "ConsentType=DoubleOptIn OptInPrompt='{OPT_IN_PROMPT}' DoubleOptInPrompt='{DBL_PROMPT}' IsRequireDoubleOptIn=true" --json > /tmp/cc-patch.jsonstatus !== 0{ok:false, kind:"channel-patch-failed", message: ...}MsgChannelLanguageKeywordreferences/language-keywords.md{ok:false, kind:"keyword-record-failed", message: ...}{ok:false, kind:"verify-failed", hint:"<which requirement is unmet>"}activationReady: trueSuccess — Consent configured — channel {CHANNEL_ID} is now {CONSENT_TYPE} with a {LANGUAGE} keyword record. Activation-ready.Info: Consent already configured — {CONSENT_TYPE}, {N} language record(s). No changes.Warning: This channel is PlatformType={x}, not Enhanced — consent fields don't apply here.Warning: Missing required consent input for {CONSENT_TYPE}: {what}. Re-run and provide it.Error: {kind}: {message}references/worked-examples.mdreferences/gotchas.md