CustomerMarketingConsent
Marketing communication consent tracking per channel for customers. Extends Consent entity with marketing-specific properties (channel, double opt-in). Supports GDPR Article 7 compliance.
Properties
Includes inherited properties from Consent
| Property | Type | Mode | Description | Required | Source |
|---|---|---|---|---|---|
| entityType | string | stored | Type of entity giving consent (Customer, Patient, Employee, User, etc.) Example: | Required | Consent |
| entityId | string | stored | Unique identifier of the entity giving consent Example: | Required | Consent |
| consentType | string | enum | Category of consent being tracked Values: Example: | Required | Consent |
| granted | boolean | stored | Whether consent is currently granted (true) or withdrawn (false) Example: | Required | Consent |
| grantedAt | DateTime | stored | Timestamp when consent was granted Example: | Optional | Consent |
| grantedIp | string | stored | IP address from which consent was granted (GDPR Article 7 proof requirement) Example: | Optional | Consent |
| grantedBy | User | stored | User who granted consent (if obtained by staff on behalf of entity) Example: | Optional | Consent |
| consentSource | string | enum | Source or method through which consent was obtained Values: Example: | Optional | Consent |
| withdrawnAt | DateTime | stored | Timestamp when consent was withdrawn Example: | Optional | Consent |
| withdrawnIp | string | stored | IP address from which consent was withdrawn Example: | Optional | Consent |
| withdrawnBy | User | stored | User who withdrew consent (if withdrawn by staff) | Optional | Consent |
| withdrawalReason | string | stored | Reason provided for consent withdrawal Example: | Optional | Consent |
| consentVersion | string | stored | Version of the consent form, policy, or terms under which consent was given Example: | Optional | Consent |
| language | Language | stored | Language in which consent was presented and obtained | Optional | Consent |
| expiresAt | DateTime | stored | Optional expiration date for time-limited consents Example: | Optional | Consent |
| metadata | object | stored | Additional consent-specific metadata (form ID, document URL, etc.) Example: | Optional | Consent |
| customer | Customer | stored | Reference to the customer who granted or withdrew consent (specialization of entityType/entityId from Consent) | Required | CustomerMarketingConsent |
| channel | string | enum | Marketing communication channel for which consent applies Values: Example: | Required | CustomerMarketingConsent |
| doubleOptIn | boolean | stored | Whether double opt-in confirmation was completed (email verification link clicked) Example: | Optional | CustomerMarketingConsent |
| doubleOptInConfirmedAt | DateTime | stored | Timestamp when double opt-in was confirmed Example: | Optional | CustomerMarketingConsent |
| unsubscribeToken | string | stored | Unique token for one-click unsubscribe functionality Example: | Optional | CustomerMarketingConsent |
| campaignType | string | enum | Type of marketing campaign this consent covers Values: Example: | Optional | CustomerMarketingConsent |
Examples
Example 1
{
"@type": "CustomerMarketingConsent",
"customer": {
"@type": "Customer",
"customerNumber": "CUST-2024-00123"
},
"channel": "email",
"granted": true,
"grantedAt": "2024-01-15T10:30:00Z",
"grantedIp": "192.168.1.100",
"consentSource": "registration_form",
"consentVersion": "2.1",
"language": {
"@type": "Language",
"code": "en",
"name": "English"
},
"doubleOptIn": true,
"doubleOptInConfirmedAt": "2024-01-15T10:35:00Z"
}Example 2
{
"@type": "CustomerMarketingConsent",
"customer": {
"@type": "Customer",
"customerNumber": "CUST-2024-00123"
},
"channel": "sms",
"granted": false,
"withdrawnAt": "2024-06-15T14:20:00Z",
"withdrawnIp": "192.168.1.105",
"withdrawalReason": "Too many promotional messages",
"consentVersion": "2.1"
}Example 3
{
"@type": "CustomerMarketingConsent",
"customer": {
"@type": "Customer",
"customerNumber": "CUST-2024-00789"
},
"channel": "email",
"granted": true,
"grantedAt": "2023-06-10T15:00:00Z",
"grantedIp": "203.0.113.50",
"consentSource": "checkout",
"consentVersion": "2.0",
"language": {
"@type": "Language",
"code": "en",
"name": "English"
},
"doubleOptIn": true,
"doubleOptInConfirmedAt": "2023-06-10T15:05:00Z"
}Example 4
{
"@type": "CustomerMarketingConsent",
"customer": {
"@type": "Customer",
"customerNumber": "CLIENT-2024-00456"
},
"channel": "whatsapp",
"granted": true,
"grantedAt": "2024-03-10T12:00:00Z",
"grantedIp": "89.156.23.45",
"consentSource": "preference_center",
"consentVersion": "2.1",
"language": {
"@type": "Language",
"code": "fr",
"name": "Français"
},
"doubleOptIn": false
}Example 5
{
"@type": "CustomerMarketingConsent",
"customer": {
"@type": "Customer",
"customerNumber": "CUST-2024-00789"
},
"channel": "phone",
"granted": true,
"grantedAt": "2023-06-10T15:00:00Z",
"grantedIp": "203.0.113.50",
"consentSource": "customer_service",
"consentVersion": "2.0",
"language": {
"@type": "Language",
"code": "en",
"name": "English"
}
}