![repliers](/mermaid-gen/repliers.mmd.svg)

MailSlurp supports automated email replies that can be configured to match particular inboxes or recipients.

## Creating inbox repliers



```typescript
// add an auto reply rule to inbox
const replier = await mailslurp.inboxReplierController.createNewInboxReplier({
  createInboxReplierOptions: {
    inboxId: inbox1.id,
    match: '*',
    field: CreateInboxReplierOptionsFieldEnum.SENDER,
    body: 'We are not home right now',
  },
});
```



## Track reply events



```typescript
// get events for inbox replier
const events = await mailslurp.inboxReplierController.getInboxReplierEvents({
  id: replier.id,
});
expect(events.numberOfElements).toEqual(1);
expect(events.content![0].status).toEqual(
  InboxReplierEventProjectionStatusEnum.SUCCESS
);
```



## Testing inbox reply



```typescript
// send email from inbox2 to inbox1 and expect an auto-reply
log.info('Send email');
const sent = await mailslurp.inboxController.sendEmailAndConfirm({
  inboxId: inbox2.id!!,
  sendEmailOptions: {
    to: [inbox1.emailAddress!!],
    subject: 'Hello',
    body: 'Are you home?',
  },
});
expect(sent.to).toContain(inbox1.emailAddress);

// see that inbox2 gets a reply
const receivedEmail = await mailslurp.waitController.waitForLatestEmail({
  inboxId: inbox2.id,
  timeout: 60000,
  unreadOnly: true,
});
expect(receivedEmail.subject).toContain('Hello');
expect(receivedEmail.body).toContain('We are not home right now');
```



## Other options

Auto-repliers are one-way responses. There are other similar options available:

- [Auto forwarding](/guides/auto-forwarding/): forward emails when received by an inbox
- [Inbox proxy](/guides/alias-email-address-proxy/): create a proxy email address between two addresses

dresses
