Email marketing: add a client with consent
email_marketing_add_contactADD a client to the e-mail marketing base (the newsletter audience) WITH their consent — the same as the «Додати в розсилку» button on a client card. Needs the e-mail and HOW the person agreed to get letters: 'verbal' (said yes in the shop / on the phone), 'written' (a form, a letter, a message) or 'requested' (asked to get the letters themselves). NEVER guess 'how': if the person did not say it, ASK «Як людина погодилась на листи: усно, письмово чи сама попросила?» — without consent nobody is added (a letter without consent is spam). Pass the client card: organization_id (a client organization, e.g. from erp_client_save / erp_client_find) or erp_contact_id (an ERP contact); with only a name/e-mail the card is found by the e-mail. Unsubscribed, bounced or complained addresses are refused and never added back. If the cabinet has double opt-in on (result 'confirmation_sent'), the person is NOT added yet — they got a «Підтвердіть підписку» letter and join after clicking it; say «надіслали лист для підтвердження», never «додано». Use it right after an e-mail was added to a client (erp_client_save, erp_create_contact) when the person says «так, додай у розсилку», or for «додай X у розсилку». Proposed write: one confirmation card. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"email": "<email>",
"how": "<how>"
},
"name": "email_marketing_add_contact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| how | Yes | ||
| note | No | Where/how, e.g. «на касі, Оболонь». | |
| Yes | |||
| client | No | The client's name as said (shown on the card). | |
| consent_date | No | YYYY-MM-DD when they agreed; default today. | |
| erp_contact_id | No | ||
| organization_id | No |