### Liquid Templating Examples for Keila Campaigns Source: https://www.keila.io/docs/campaigns Demonstrates the use of Liquid templating in Keila campaigns for accessing contact information and generating dynamic content. Supports contact properties like email, first name, last name, and custom data fields. Also shows how to use the default filter for missing data. ```liquid {{ contact.email }} {{ contact.first_name }} {{ contact.last_name }} {{ contact.data.my_field }} Hey {{ contact.first_name | default: "there" }} ``` -------------------------------- ### API Keys Management Source: https://www.keila.io/docs/api Instructions on how to create and manage API keys required for authenticating with the Keila API. ```APIDOC ## API Keys In order to start using the API, you first need to create an API Key. To create a new API key, select “API Keys” from the menu on the left, then click on “Create new API key”. Choose a name for your API key and confirm by clicking on “Save”. Now, the private API key is displayed. The key will only be displayed once and can’t be retrieved again. ``` -------------------------------- ### Keila API Authentication Source: https://www.keila.io/docs/api This section details how to authenticate your API calls using Bearer authentication with your private API key. ```APIDOC ## Authentication For authenticating your API calls, use the _Bearer_ authentication scheme with your private API key. ### Method `POST` (example, actual method depends on the endpoint) ### Endpoint `/your/api/endpoint` (example) ### Headers - **Authorization** (string) - Required - `Bearer YOUR_PRIVATE_API_KEY` ``` -------------------------------- ### Markdown Button Trick for Keila Campaigns Source: https://www.keila.io/docs/campaigns Shows a Markdown syntax trick supported by Keila to create call-to-action buttons within Markdown-formatted campaigns. This method leverages standard Markdown link syntax with specific formatting. ```markdown #### [Your text](https://example.com) #### ``` -------------------------------- ### Keila Query Language: $like Operator Source: https://www.keila.io/docs/segments The '$like' operator provides pattern matching capabilities using the '%' wildcard. It's useful for partial string matches in fields like email addresses or names. ```json { "email": { "$like": "%@keila.io" } } ``` ```json { "first_name": { "$like": "%a%" } } ``` -------------------------------- ### Keila Query Language: Comparison Operators Source: https://www.keila.io/docs/segments Relative comparison operators like '$lt', '$lte', '$gt', and '$gte' allow for numerical and date-based comparisons. These are essential for segmenting based on ranges or specific thresholds. ```json { "inserted_at": { "$lt": "2022-01-01T00:00:00Z" } } ``` -------------------------------- ### Keila Query Language: Match Exact Values Source: https://www.keila.io/docs/segments The 'match' operator in Keila's query language is used to find contacts with exact values for specific fields or exact elements within an array. This is the simplest form of matching and does not support wildcards. ```json { "email": "joe@example.com" } ``` ```json { "data.age": 30 } ``` ```json { "data.tags": "rocket-scientist" } ``` -------------------------------- ### Keila Message-Based Segmentation: Opened Campaign Source: https://www.keila.io/docs/segments Create segments of contacts who have opened a specific campaign. By checking 'opened_at' is not empty, you can identify engaged recipients. ```json { "messages": { "campaign_id": "your-campaign-id", "opened_at": { "$empty": false } } } ``` -------------------------------- ### Keila Query Language: $and Operator Source: https://www.keila.io/docs/segments The '$and' operator combines multiple conditions, requiring all of them to be true for a contact to be included in the segment. This is useful for creating highly specific criteria. ```json { "$and": [ { "data.tags": "rocket-scientist" }, { "data.tags": "book-enthusiast" } ] } ``` -------------------------------- ### Keila Query Language: $empty Operator Source: https://www.keila.io/docs/segments The '$empty' operator checks if a field is considered empty, including null, empty strings, empty lists, or empty objects. It can also be used to find contacts that *do* have a value in a field. ```json { "first_name": { "$empty": true } } ``` ```json { "data.custom_field": { "$empty": false } } ``` -------------------------------- ### Keila Query Language: $or Operator Source: https://www.keila.io/docs/segments The '$or' operator allows for flexible segmentation by matching contacts if at least one of the specified conditions is met. This is useful when a contact can satisfy multiple criteria. ```json { "$or": [ { "data.tags": "rocket-scientist" }, { "data.tags": "book-enthusiast" } ] } ``` -------------------------------- ### Keila Query Language: $not Operator Source: https://www.keila.io/docs/segments The '$not' operator negates a condition, allowing you to segment contacts who do *not* meet a specific criterion. This is useful for exclusion criteria. ```json { "$not": { "data.tags": "rocket-scientist" } } ``` -------------------------------- ### Keila Message-Based Segmentation: Clicked Campaign Link Source: https://www.keila.io/docs/segments Target contacts who have clicked a link within a specific campaign. Using 'clicked_at' with '$empty: false' identifies highly interactive recipients. ```json { "messages": { "campaign_id": "your-campaign-id", "clicked_at": { "$empty": false } } } ``` -------------------------------- ### Keila Message-Based Segmentation: Not Interacted with Campaign Source: https://www.keila.io/docs/segments Segment contacts who have not interacted with a campaign, including those who haven't received it, using the '$not' operator. Alternatively, target those who received but did not open using '$empty: true' for 'opened_at'. ```json { "$not": { "messages": { "campaign_id": "your-campaign-id", "opened_at": { "$empty": false } } } } ``` ```json { "messages": { "campaign_id": "your-campaign-id", "opened_at": { "$empty": true } } } ``` -------------------------------- ### Keila Message-Based Segmentation: Received Campaign Source: https://www.keila.io/docs/segments Segment contacts based on whether they received a specific campaign. The 'messages' field with 'campaign_id' allows targeting contacts who have been sent a particular campaign. ```json { "messages": { "campaign_id": "your-campaign-id" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.