Can you write liquid code for braze which detects today's day
- User
Can you write liquid code for braze which detects today's day
Assistant
Here is some liquid code for Braze that detects today's day of the week:
{% assign day = 'now' | date: "%A" %} {% if day == "Monday" %} Today is Monday! {% elsif day == "Tuesday" %} Today is Tuesday! {% elsif day == "Wednesday" %} Today is Wednesday! {% elsif day == "Thursday" %} Today is Thursday! {% elsif day == "Friday" %} Today is Friday! {% elsif day == "Saturday" %} Today is Saturday! {% else %} Today is Sunday! {% endif %}Breakdown:
- The
{% assign %}tag assigns the day of the week from the current date (usingnow) to thedayvariable. - The date filter
"%A"returns the full day name (e.g. "Monday"). - An
{% if %}conditional checks the value ofdayand outputs the corresponding day name.
- The
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.