Skip to content

Commit 7145282

Browse files
committed
code format fix
1 parent a41a047 commit 7145282

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

src/connections/destinations/actions.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,19 @@ Below are two examples demonstrating how to use Liquid templates in Segment mapp
339339
##### Example 1: Standardize email addresses
340340
This example converts an email address to lowercase and removes extra whitespace, ensuring consistency for a destination.
341341

342-
```json
343-
{% if event.properties.email %}
344-
{{ event.properties.email | downcase | strip }}
345-
{% else %}
346-
{{ event.properties.email | default: "[email protected]" }}
347-
{% endif %}
342+
343+
```
344+
{% raw %}
345+
{% if event.properties.email %}
346+
{{ event.properties.email | downcase | strip }}
347+
{% else %}
348+
{{ event.properties.email | default: "[email protected]" }}
349+
{% endif %}
350+
{% endraw %}
348351
```
352+
349353
Input: `event.properties.email` = "[email protected]"
354+
350355
351356

352357
Explanation:
@@ -358,18 +363,23 @@ Explanation:
358363
##### Example 2: Transform phone number with conditional logic
359364
This example formats a phone number by removing non-digit characters, adding a country code, and prepending a plus sign.
360365

361-
```json
362-
{% if event.properties.phone %}
363-
{% assign phone = event.properties.phone | strip | remove: "-" | remove: "(" | remove: ")" | remove: " " %}
364-
{% if phone | slice: 0, 1 != "1" %}
365-
{% assign phone = phone | prepend: "1" %}
366+
367+
```
368+
{% raw %}
369+
{% if event.properties.phone %}
370+
{% assign phone = event.properties.phone | strip | remove: "-" | remove: "(" | remove: ")" | remove: " " %}
371+
{% if phone | slice: 0, 1 != "1" %}
372+
{% assign phone = phone | prepend: "1" %}
373+
{% endif %}
374+
{{ phone | prepend: "+" }}
375+
{% else %}
376+
{{ event.properties.phone | default: "" }}
366377
{% endif %}
367-
{{ phone | prepend: "+" }}
368-
{% else %}
369-
{{ event.properties.phone | default: "" }}
370-
{% endif %}
378+
{% endraw %}
371379
```
380+
372381
Input: `event.properties.phone` = "(123) 456-7890"
382+
373383
Output: +11234567890
374384

375385
Explanation:

0 commit comments

Comments
 (0)