Send emails from an Agent

Use the Send email action to send contextual emails as part of the expense audit workflows. You can use send email for scenarios such as:

  • To request clarification or supporting documentation from the submitter instead of rejecting the expense report.
  • To educate repeat policy violators by emailing the submitter and copying the manager.
  • To escalate suspected fraud to a compliance or review team.

You can send an email with the following two methods:

  • Using an email template
  • Sending an email without a template

Create an email template

The email template capability enables you to create reusable templates that support dynamic, context-aware communication within the expense audit workflow. These templates use large language models (LLM) to generate user-friendly messages based on the agent’s evaluation.

When you create a template, you can embed dynamic variables, including the LLM message, which generates content at runtime. The LLM interprets the agent’s reasoning and produces a clear summary that explains:

  • What issue was identified
  • Why the action was taken
  • What the user needs to do next

For more information on creating email templates refer to Create new templates.

Agents primarily evaluate data at the line level, where multiple models or itemizations may contribute to a decision. The LLM consolidates this information and presents it as a concise, report-level message, ensuring that complex reasoning is easy for users to understand.

You can also guide the LLM by providing prompts within the template. These prompts define the structure, tone, and key details of the email, such as including report information or specific instructions for the recipient.

In addition to predefined templates, you can configure inline emails for scenarios where a standard template does not exist, such as communication with a fraud or compliance team. In these cases, you define the recipients and provide prompts for the subject and body, and the LLM generates the final content.

The system supports both dynamic and static recipients. You can use roles such as submitter, manager, and auditor to ensure emails are sent to the appropriate stakeholders based on each report, or specify fixed email addresses when needed. 

This capability enables scalable, consistent, and context-aware communication while reducing manual effort and improving clarity for end users. 

To learn more about email templates refer to Email templates and customizations.

Using an email template 

Use the Send email action to notify users or request additional information as part of the expense audit workflow. You can configure emails using predefined templates that include dynamic variables and LLM-generated content.

For example, you can configure an agent to send an email to the submitter when a receipt is incomplete, requesting a complete document instead of rejecting the report.

Before you begin

  • Create or select a template.
  • Ensure an email template is available.
  • Confirm that required variables (such as submitter or manager email) are configured

Configure the send email action

To send an email, follow these steps:

  1. Goto the Mastermind platform from the App Switcher.
  2. Select AI Agent Studio from the left navigation panel.
  3. Select the required app and click Edit app.

  1. Open the agent configuration.
  2. Add or select the Send email.
  3. Select an email template.
    The system displays a preview of the selected template so you can review the subject and body content.

  1. Configure recipients:
    1. Use dynamic variables such as:
      1. Submitter email address
      2. Submitter’s manager email address
      3. Auditor email address
  2. Configure the email subject:
    1. Add static text
    2. Insert supported variables, such as report ID or username
  3. Configure the email body:
    1. Add static content
    2. Insert dynamic variables, such as:
      1. Report name
      2. Submitter name
      3. Line or header details
  4. Include the LLM message variable to generate a contextual summary.
    The LLM message provides:
    1. A summary of the issue
    2. The reason for the action
    3. Guidance on next steps
  5. Save the configuration.

Notes

  • Templates support dynamic variables that populate values at runtime.
  • If a variable does not have a value (for example, an unsupported custom field), the email still sends, but the field appears blank.
  • The LLM message dynamically generates content based on the agent’s evaluation.

To learn more about email templates refer to Email templates and customizations.

Sending an email without a template

Use the Send email action to generate and send contextual emails based on agent outcomes. The system uses a large language model (LLM) to generate email content based on the guidance you provide.

Instead of manually writing the subject and body, you define prompts that describe the intent, tone, and required content. The LLM uses this guidance to generate a clear and user-friendly email.

This approach is useful when you need flexible, scenario-specific communication that is not fully defined by a template. To configure the Send email action using prompts, follow these steps:

  1. Open the agent configuration.
  2. Add or select the Send email action.
  3. Define recipients:
    • Select dynamic roles such as:
      • Submitter
      • Auditor

  1. Provide guidance for the email subject:
    • Enter a prompt that describes the expected subject. Example: Include the expense report ID and indicate that action is required.
  2. Provide guidance for the email body:
    • Enter a prompt that describes:
      • The purpose of the email
      • The issue identified
      • The expected action from the recipient
  3. (Optional) Include attachments, if required.
  4. Review additional options:
    • Enable auditor review, if applicable
    • Configure CC and BCC recipients
  5. Enter the required subject.
  6. Save the configuration.

Was this article helpful?
0 out of 0 found this helpful