Sort by Topics, Resources
Clear
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Salto for

Zendesk

Articles

SHARE

Using dynamic dates to revolutionise Zendesk macros and business rules

Jude Kriwald

September 12, 2023

4

min read

Zendesk macros, triggers and automations are some of the most popular features of Zendesk users around the world. They are powerful time-savers that ensure your customers can get speedy, high-quality responses without agents breaking a sweat. They are a perfect example of features with a high impact yet low barrier to entry.

Experience the Ease & Confidence of NetSuite Customizations with Salto

Automate the way you migrate Jira configurations from sandbox to production

STAY UP TO DATE

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Get Started with Salto

What if Zendesk was 4x less work?

Request a Demo ≥

Challenge

That said, sometimes we want to push our macros, triggers or automations further than is immediately obvious. What if, for example, you want to include custom, time-based dynamic text into your macros or triggers that send emails? Almost all of us will have worked on or experienced a Zendesk instance that automatically tells its customers they’ll receive a reply in three working days. While that’s pretty clear, for a truly excellent customer experience, we can go one step further and be specific about that date and time, all without having to lift a finger.

Imagine emailing a support team and receiving these two responses:

Your request ([email subject]) has been received and is being reviewed by our support staff.

To add additional comments, reply to this email.

Whilst this is the default response from a Zendesk account that hasn’t been modified, you can do so much better, and it can all be just as automated as the above.

Hi Julia,

Thank you for your email. I just wanted to let you know that our team has received it safely. We’ll get back to you no later than Thursday by 4 pm.

I hope you have a wonderful day and we look forward to helping you soon.

Kind regards,

Jude,

[company name]

See how much nicer that is to read? In this series, I’ll show you how to create an auto-response just like this.

Understanding dynamic dates

To write a dynamic date and/or time in Zendesk, we need to use a specific syntax. That syntax is known as Ruby. You may have heard of Ruby as one of the most popular programming languages today. Fret not though, for you do not need to be a programmer to know how to put this to good use. In this article, I’ll share some of the best examples of dynamic dates that you can copy and paste directly into your Zendesk account.

All of the below examples can be copied into macros, triggers, automations and more. You can also copy them directly into Zendesk’s comment editor to test them before saving. 

When you first copy them into a text editor on Zendesk (such as the comment editor or macro editing screen), the string, as these bundles of code are known, will not update to the desired date/time right away. It’s only once you actually submit a ticket, or your trigger/automation fires, that you’ll see that Zendesk has processed your string into a legible date and time.

STAY UP TO DATE

Tips & tricks from Zendesk masters

Subscribe to our newsletter to learn how to customize Zendesk and keep your agents happy

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

This is a monthly email with educational content. No spam (we promise).

Dynamic date examples

Try copying and pasting these into the Zendesk comment editor, then submitting the ticket, to see what they look like. Remember that these are just examples, and the output dates will vary depending on what the date is when you try this. As you can tell, I tested these out on June 23rd, 2023, which was a Friday.

Current date

Use case:

This is the most basic building block of all the strings below. It will always display the current date of the UTC time zone (see part 2 of this series for much more on time zones).

String:
{{'now' | date:'%Y-%m-%d'}}

Output:
2023-06-23

Current date and time

Use case:

The same as above, but when you need to display the current time too.

String:
{{'now' | date:'%Y-%m-%d %H:%M'}}

Output:
2023-06-23 12:52

Current date plus 30 days

Use case:

This string is particularly useful for time-limited offers like free trials. You could use it in an automated welcome email to let a customer know on which date their trial will end. The number shown is 30 days, expressed in seconds. Zendesk always computes time calculations in seconds, so you’ll need to convert whatever time you’re working with into seconds.

String:
        {{ 'now' | date: '%s' | plus:2592000| date: '%Y-%m-%d' }}

Output:
2023-07-23

Current date minus 30 days

Use case:

This is probably not as common, but it’s useful even if it’s just to demonstrate how to subtract a period of time. 

String:
        {{ 'now' | date: '%s' | minus:2592000| date: '%Y-%m-%d' }}

Output:
2023-05-24

In Part 2, we’ll cover more advanced dynamic dates. Stay tuned for Part 3 too, as I’ll show you how to format the outputted dates into a much friendlier date intended for human consumption!

WRITTEN BY OUR EXPERT

Jude Kriwald

Zendesk Consultant

Jude Kriwald first learned to administer Zendesk in 2015 and has been helping businesses improve their customer operations as a freelance consultant since 2018. Offline, he can be found making maps, paragliding or exploring remote places.

Sort by Topics, Resources
Clear
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Salto for

Zendesk

Zendesk

SHARE

Using dynamic dates to revolutionise Zendesk macros and business rules

Jude Kriwald

September 12, 2023

4

min read

Zendesk macros, triggers and automations are some of the most popular features of Zendesk users around the world. They are powerful time-savers that ensure your customers can get speedy, high-quality responses without agents breaking a sweat. They are a perfect example of features with a high impact yet low barrier to entry.

What if Zendesk was 4x less work?

Request a Demo Get started with Salto

Challenge

That said, sometimes we want to push our macros, triggers or automations further than is immediately obvious. What if, for example, you want to include custom, time-based dynamic text into your macros or triggers that send emails? Almost all of us will have worked on or experienced a Zendesk instance that automatically tells its customers they’ll receive a reply in three working days. While that’s pretty clear, for a truly excellent customer experience, we can go one step further and be specific about that date and time, all without having to lift a finger.

Imagine emailing a support team and receiving these two responses:

Your request ([email subject]) has been received and is being reviewed by our support staff.

To add additional comments, reply to this email.

Whilst this is the default response from a Zendesk account that hasn’t been modified, you can do so much better, and it can all be just as automated as the above.

Hi Julia,

Thank you for your email. I just wanted to let you know that our team has received it safely. We’ll get back to you no later than Thursday by 4 pm.

I hope you have a wonderful day and we look forward to helping you soon.

Kind regards,

Jude,

[company name]

See how much nicer that is to read? In this series, I’ll show you how to create an auto-response just like this.

Understanding dynamic dates

To write a dynamic date and/or time in Zendesk, we need to use a specific syntax. That syntax is known as Ruby. You may have heard of Ruby as one of the most popular programming languages today. Fret not though, for you do not need to be a programmer to know how to put this to good use. In this article, I’ll share some of the best examples of dynamic dates that you can copy and paste directly into your Zendesk account.

All of the below examples can be copied into macros, triggers, automations and more. You can also copy them directly into Zendesk’s comment editor to test them before saving. 

When you first copy them into a text editor on Zendesk (such as the comment editor or macro editing screen), the string, as these bundles of code are known, will not update to the desired date/time right away. It’s only once you actually submit a ticket, or your trigger/automation fires, that you’ll see that Zendesk has processed your string into a legible date and time.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Dynamic date examples

Try copying and pasting these into the Zendesk comment editor, then submitting the ticket, to see what they look like. Remember that these are just examples, and the output dates will vary depending on what the date is when you try this. As you can tell, I tested these out on June 23rd, 2023, which was a Friday.

Current date

Use case:

This is the most basic building block of all the strings below. It will always display the current date of the UTC time zone (see part 2 of this series for much more on time zones).

String:
{{'now' | date:'%Y-%m-%d'}}

Output:
2023-06-23

Current date and time

Use case:

The same as above, but when you need to display the current time too.

String:
{{'now' | date:'%Y-%m-%d %H:%M'}}

Output:
2023-06-23 12:52

Current date plus 30 days

Use case:

This string is particularly useful for time-limited offers like free trials. You could use it in an automated welcome email to let a customer know on which date their trial will end. The number shown is 30 days, expressed in seconds. Zendesk always computes time calculations in seconds, so you’ll need to convert whatever time you’re working with into seconds.

String:
        {{ 'now' | date: '%s' | plus:2592000| date: '%Y-%m-%d' }}

Output:
2023-07-23

Current date minus 30 days

Use case:

This is probably not as common, but it’s useful even if it’s just to demonstrate how to subtract a period of time. 

String:
        {{ 'now' | date: '%s' | minus:2592000| date: '%Y-%m-%d' }}

Output:
2023-05-24

In Part 2, we’ll cover more advanced dynamic dates. Stay tuned for Part 3 too, as I’ll show you how to format the outputted dates into a much friendlier date intended for human consumption!

WRITTEN BY OUR EXPERT

Jude Kriwald

Zendesk Consultant

Jude Kriwald first learned to administer Zendesk in 2015 and has been helping businesses improve their customer operations as a freelance consultant since 2018. Offline, he can be found making maps, paragliding or exploring remote places.