Examples of communications templates for pipelines

Ready-made examples of communications templates with variables that you can use to send in pipelines
Written by Владислав Пономарь
Updated 2 weeks ago

In keyCRM, you can create communication templates and use them to send messages in chat or via trigger automation.

We have prepared several ready-made templates that contain variables that substitute the saved data from the pipeline card fields into the message text.

Note! All templates below have variables and will only work if the «Pipeline» context is selected in the communication template settings. The «General» context does not support variables.

1. Application for products:

Good afternoon, {{ model.contact_name }}!
Your order has been placed:
{% for product in model.products %}
{{ product.name }} - {{ product.quantity }} pcs.
{% endfor %}
Total: {{ model.products_sum}} USD.

2. Welcome message depending on the time of sending

{% if "now"|date("H", "Europe/Kyiv") < 18 %}
We are glad to welcome you 🙂 Please wait to be connected to a manager 💙
{% else %}
Our working day is over, so we will definitely get back to you tomorrow 💙
{% endif %}

Welcome message depending on the day of the week and time of sending

{# 1. Define time and day variables to simplify the logic #}
{% set day  = 'now'|date("w", "Europe/Kyiv") %}
{% set hour = 'now'|date("H", "Europe/Kyiv") %}

{% set is_weekend = (day == 0 or day == 6) %}
{% set is_business_hours = (hour >= 9 and hour < 20) %}

{# 2. Output messages based on the conditions #}
{% if is_weekend %}
    {% if is_business_hours %}
        Good afternoon! Today is a day off, so your order will be processed on the next business day.
    {% else %}
        Good evening! Today is a day off, so your order will definitely be processed on a working day.
    {% endif %}
{% else %}
    {% if is_business_hours %}
        Good afternoon! Your order has been accepted. A manager will contact you shortly.
    {% else %}
        Good evening! Your order has been accepted, but our working day has already ended, so we will definitely contact you tomorrow.
    {% endif %}
{% endif %}

3. Messages with different text

Usually, automatic messages are identical, and if you send a large number of them, you may be blocked for spam.

To reduce the likelihood of this happening, you can use the method of replacing words or phrases according to the card ID in the pipeline:

{% set last_digit = model.id|split('')|last %}
{% if last_digit in ['1', '4', '7'] %}
Good afternoon! 🙂
{% elseif last_digit in ['2', '6', '8'] %}
Good afternoon! 😉
{% elseif last_digit in ['3', '5', '9'] %}
Hello! ♥️
{% elseif last_digit == '0' %}
Hello! 👋
{% endif %}

{% set last_digit = model.id|split('')|last %}
{% if last_digit in ['4', '5', '0'] %}
We are pleased to inform you that we have received your application and have begun processing it. We will send you the details shortly.
{% elseif last_digit in ['3', '6', '9'] %}
We have received your request and are working on it. We will contact you with details shortly.
{% elseif last_digit in ['2', '7', '8'] %}
We are sending this message to confirm receipt of your application. Please wait for our specialist to contact you for clarification, if necessary.
{% elseif last_digit == '1' %}
We have received your request and are ready to fulfill it. Our team will contact you to confirm the information.
{% endif %}

4. Sending only the customer's name or contact details in the chat (without the surname)

If you store the full name of customers or contacts in the format «Ivan Petrenko»:

{% set foo = model.contact_name|split(' ')%}
Hello, {{ foo|last }}!

If you store the full name of customers or contacts in the format «Limanso Jackson»:

{% set foo = model.contact_name|split(' ')%}
Hello, {{ foo|first }}!

If you store the full name of customers or contacts in the format «Jackson Robert Limanso»:

{% set foo = model.client_name|split(' ') %}
Hello, {{ foo[1] }}!

5. Sending a link to the invoice for online payments

If you issue invoices for online payment with WayForPay, Plata by mono acquiring, LiqPay, Fondy, RozetkaPay, NovaPay, you can add the variable «Payments: Payment link» to the document template so that the link is automatically added to the message text.

We are awaiting payment for order {{ model.title }}:

{% for payment in model.payments %}
{% if payment.invoice_url %}
Amount: {{ payment.amount }} USD
Payment link: {{ payment.invoice_url }}
{% endif %}
{% endfor %}

Tags: message template, SMS template, SMS template example, custom message, pipeline message, message code
Did this answer your question?