Skip to content

Add {{agentName}} support to agent response templates #99

Description

@warengonzaga

Summary

Add support for a new {{agentName}} template variable so admins can include the responding agent's display name in Telegram agent response messages.

Problem

The current template builder for agent_response does not expose sender information. Admins can customize the message layout, but they cannot show who sent the response from the Unthread dashboard.

Current Behavior

  • Agent response templates support variables like {{ticketNumber}} and {{response}}.
  • Sender information is not exposed as a template variable.
  • The webhook/template rendering path would need to pass a stable display name from the webhook payload into the template renderer.

Desired Behavior

  • Support a new variable: {{agentName}}
  • Expose it in the template builder documentation/variable list.
  • Populate it from the webhook payload when available.
  • Fall back safely when the sender name is unavailable or empty.

Suggested Scope

  • Add agentName to the available template variables for agent responses.
  • Update the webhook message formatting path to pass agentName into template rendering.
  • Decide fallback behavior when sender info is missing.
  • Optionally update the default agent_response template to use {{agentName}} once the data path is stable.

Acceptance Criteria

  • Admins can include {{agentName}} in the agent_response template.
  • Rendered Telegram messages include the sender name when available.
  • Missing sender names do not break template rendering.
  • Tests cover both present and missing sender-name cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions