I have a compound action:
steps:
- for:
output_key: user_bookings
each: booking
in: data.list_of_user_bookings
index: user_index
steps:
- try_catch:
try:
steps:
- action:
action_name: mw.get_user_by_email
output_key: got_user
input_args:
user_email: booking.email
- switch:
cases:
- condition: data.lang == "es"
steps:
- notify:
output_key: officespace_output1
recipient_id: data.got_user.user.id
resources:
- name: instructions
datatype: string
value: '"Do not translate this message. Always display in Spanish"'
message:
RENDER():
args:
booking_date: booking.booking_date
booking_desk: booking.desk
booking_office: booking.office
template: >
Tiene una reserva para el escritorio <b>{{booking_desk}}</b> en
<b>{{booking_office}}</b> mañana ({{booking_date}}).
En caso de no asistir, por favor haga clic en el botón a continuación para cancelar
su reserva.
actions:
- key: cancel1
label: '"Cancela mi escritorio"'
system_action:
action_name: Cancel_desk_booking
input_args:
booking_date: booking.booking_date
booking_id: booking.booking_id
user_email: booking.email
default:
steps:
- notify:
output_key: officespace_output2
recipient_id: data.got_user.user.id
resources:
- name: instructions
datatype: string
value: '"Do not translate this message. Always display in Spanish"'
message:
RENDER():
args:
booking_date: booking.booking_date
booking_desk: booking.desk
booking_office: booking.office
template: >
You have booked desk <b>{{booking_desk}}</b> at <b>{{booking_office}}</b> for tomorrow
({{booking_date}}).
There is a high demand for desks, so if you are not going to be in the office tomorrow
please click the button below to cancel your desk
actions:
- key: cancel2
label: '"Cancel My Desk"'
system_action:
action_name: Cancel_desk_booking
input_args:
booking_date: booking.booking_date
booking_id: booking.booking_id
user_email: booking.email
catch:
steps: []As you can see, If data.lang = “es” then it should display the message in Spanish, other wise it should display the message in English.
I initially thought that the bot would automatically translate to the local language, but that didn’t happen, so I added this extra bit to display a translated message.
However, in the logs it shows it displaying in Spanish:

But to the user it shows it in English (yet the button sometimes appears in Spanish):

I’ve even added the instructions: "Do not translate this message. Always display in Spanish"
but it doesn’t seem to do anything.
FYI. The OfficeSpace mentioned is not the retail product, that you have connectors for. It is our internally developed system.