---
schema_version: "1"
id: 14ff890f2afe782762a7e1a1609419f616775b71503c6f67509c068455debac6
title: AutoResponseRules
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_autoresponserules.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_autoresponserules.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: fecebd1b07d27789ff4377322eac54da5488a5a0afadb4612ee9a94a92637563
description: Represents an auto-response rule that sets conditions for sending automatic email responses to lead or case submissions based on the attributes of the submitted record. You can access rules metadata for all applicable objects, for a specific object, or for a specific rule on a specific object.
---
# AutoResponseRules

Represents an auto-response rule that sets conditions for sending automatic email responses to lead or case submissions based on the attributes of the submitted record. You can access rules metadata for all applicable objects, for a specific object, or for a specific rule on a specific object.

The package.xml syntax for accessing all auto-response rules for all objects is:

    <types>
        <members>\*</members>
        <name>AutoResponseRules</name>
    </types>

All rules for a specific object use a similar syntax without the wildcard. For example, all auto-response rules for the Case object would use this syntax:

    <types>
        <members>Case</members>
        <name>AutoResponseRules</name>
    </types>

You can also access specific auto-response rules for an object. The following example only accesses the “samplerule” and “newrule” auto-response rules on the Case object. Notice that for this example the type name syntax is AutoResponseRule and not AutoResponseRules.

    <types>
        <members>Case.samplerule</members>
        <members>Case.newrule</members>
        <name>AutoResponseRule</name>
    </types>

## File Suffix and Directory Location

AutoResponseRules for an object have the suffix .autoResponseRules and are stored in the autoResponseRules folder. For example, all Case auto-response rules are stored in the Case.autoResponseRules file.

## Version

AutoResponseRules components are available in API version 27.0 and later.

## Fields

| Field Name | Field Type | Description |
| --- | --- | --- |
| autoresponseRule | [AutoResponseRule\[\]](#autoresponserule_sub) | Represents the definitions of the named auto-response rules. |

## AutoResponseRule

Represents whether a rule is active or not and the order in which the entry is processed in the rule.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d166349e162">Field Name</th>

              <th class="featureTableHeader  " id="d166349e165">Field Type</th>

              <th class="featureTableHeader  " id="d166349e168">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d166349e162" data-title="Field Name"><span class="keyword parmname">active</span></td>

              <td class="entry" headers="d166349e165" data-title="Field Type">boolean</td>

              <td class="entry" headers="d166349e168" data-title="Description">Indicates whether the autoresponse rule is active (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>).</td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e162" data-title="Field Name"><span class="keyword parmname">fullname</span></td>

              <td class="entry" headers="d166349e165" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e168" data-title="Description">Inherited from <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a>, this field is defined in the WSDL for this
                metadata type. It must be specified when creating, updating, or
                deleting. See <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_createMetadata.htm" title="Adds one or more new metadata components to your organization synchronously."><samp class="codeph java">createMetadata()</samp></a>
                to see an example of this field specified for a call.<p class="p">This value
                  can't be <samp class="codeph java">null</samp>.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e162" data-title="Field Name"><span class="keyword parmname">ruleEntry</span></td>

              <td class="entry" headers="d166349e165" data-title="Field Type"><a class="xref" href="#RuleEntry">RuleEntry[]</a></td>

              <td class="entry" headers="d166349e168" data-title="Description">Represents the type and description for the auto-response rule.
              </td>

            </tr>

          </tbody>

        </table>

## RuleEntry

Represents the fields used by the rule.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d166349e271">Field Name</th>

              <th class="featureTableHeader  " id="d166349e274">Field Type</th>

              <th class="featureTableHeader  " id="d166349e277">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">booleanFilter</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e277" data-title="Description">Advanced filter conditions that were specified for the rule.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">criteriaItems</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type"><span class="keyword parmname"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm#filteritem">FilterItem</a>[]</span></td>

              <td class="entry" headers="d166349e277" data-title="Description">The items in the list that define the assignment criteria.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">formula</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e277" data-title="Description">The validation formula.<p class="p">Specify either
                  <span class="keyword parmname">formula</span> or
                  <span class="keyword parmname">criteriaItems</span>, but not both fields.
                </p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">replyToEmail</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e277" data-title="Description">The email address that appears in the reply-to header. </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">senderEmail</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e277" data-title="Description">The email address of the person or queue sending the email
                notification. </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">senderName</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e277" data-title="Description">The name of the person or queue sending the email notification.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d166349e271" data-title="Field Name"><span class="keyword parmname">template</span></td>

              <td class="entry" headers="d166349e274" data-title="Field Type">string</td>

              <td class="entry" headers="d166349e277" data-title="Description">Specifies the template to use for the email that is automatically
                sent to the designated recipient. <p class="p">Lightning email templates
                  aren’t packageable. We recommend using a Classic email
                  template.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is an example AutoResponseRules component:

<AutoResponseRules xmlns="http://soap.sforce.com/2006/04/metadata">
    <autoResponseRule\>
        <fullName\>ajbdeploytest2</fullName\>
        <active\>false</active\>
        <ruleEntry\>
            <criteriaItems\>
                <field\>Case.Description</field\>
                <operation\>contains</operation\>
                <value\>testing</value\>
            </criteriaItems\>
            <senderEmail\>test@test.org</senderEmail\>
            <senderName\>tester name j</senderName\>
            <replyToEmail\>test@@test.org</replyToEmail\>
            <template\>emailtemplate</template\>
        </ruleEntry\>
    </autoResponseRule\>
</AutoResponseRules\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").