You can reply to an inbound email with the replyToEmail API.

This operation requires the following permissions:

  • email:create
  • email:read
  • attachment:download
import { PlainClient } from '@team-plain/typescript-sdk';

const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });

const res = await client.replyToEmail({
  customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95',
  inReplyToEmailId: 'em_01GM2X8K7D3RZ7ZFGHZ2AYG3SA',
  textContent: 'The plain text version of your reply goes here.',
  markdownContent: 'The markdown **version** of your _reply_ goes here.',
});

if (res.error) {
  console.error(res.error);
} else {
  console.log(res.data);
}