> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intelliprint.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Choose a Content Strategy

> You can send items with Intelliprint in a number of ways.

* **Files**: You can upload pre-generated files to Intelliprint to print and send directly.
* **Content**: You can generate a print job from text or HTML content.
* **Templates**: You can generate a print job from any pre-designed template in your account.

## Files

You can upload pre-generated PDF, Word, RTF, PNG or JPEG files to be printed and sent as a letter or a postcard directly via the Intelliprint API.

<Note>
  If your file for a letter already has an address placed in the correct position, you do not need to provide any recipients separately, Intelliprint will read the recipient address directly from the file.
</Note>

<CodeGroup>
  ```javascript Node.js SDK theme={null}
  import Intelliprint from 'intelliprint'

  const ip = new Intelliprint('your-api-key-here')

  import fs from 'fs' // [!code ++]

  const printJob = await ip.prints.create({
    type: 'letter',
    file: fs.createReadStream('path/to/my/letter.pdf'),  // [!code ++]
    recipients: [{
      address: {
        name: 'John Doe',
        line: '123 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      }
    }],
    confirmed: false //Set to 'true' when you're ready to start submitting mail for printing.
  })

  console.log('Print job created:', printJob.id)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.intelliprint.net/v1/prints \
    -H 'Authorization: YOUR_API_KEY' \
    -F 'type=letter' \
    -F 'file=@path/to/my/letter.pdf' \
    -F 'recipients[0][address][name]=John Doe' \
    -F 'recipients[0][address][line]=123 Main Street, Anytown, Anyplace' \
    -F 'recipients[0][address][postcode]=AB1 2CD' \
    -F 'recipients[0][address][country]=GB' \
    -F 'confirmed=false'
  ```
</CodeGroup>

## Text Content

You can provide the text or HTML-formatted content of your mail item directly as a string in the `content` field.

<Note>
  To make your letter look even better, consider applying a background image or letterhead to your print job.
</Note>

<CodeGroup>
  ```javascript Node.js SDK theme={null}
  import Intelliprint from 'intelliprint'

  const ip = new Intelliprint('your-api-key-here')

  const printJob = await ip.prints.create({
    type: 'letter',
    content: 'Hello World!\nThis is a letter!', // [!code ++]
    recipients: [{
      address: {
        name: 'John Doe',
        line: '123 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      }
    }],
    confirmed: false //Set to 'true' when you're ready to start submitting mail for printing.
  })

  console.log('Print job created:', printJob.id)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.intelliprint.net/v1/prints \
    -H 'Authorization: YOUR_API_KEY' \
    -d 'type=letter' \
    -d 'content=Hello World!\nThis is a letter!' \
    -d 'recipients[0][address][name]=John Doe' \
    -d 'recipients[0][address][line]=123 Main Street, Anytown, Anyplace' \
    -d 'recipients[0][address][postcode]=AB1 2CD' \
    -d 'recipients[0][address][country]=GB' \
    -d 'confirmed=false'
  ```
</CodeGroup>

## Templates

You can design your own templates in the [Intelliprint Dashboard](https://dashboard.intelliprint.net).
The Template Designer is available in the Bulk mail -> (Create a mailing list) -> (Choose or create a template) section.

<Note>
  Templates can use Dynamic Fields (variables) to tailor the template for each recipient. Dynamic Fields can be applied for textboxes or QR codes.
</Note>

Once you have created a template, you should find its `ID` in the URL when you view the template in the Dashboard.

<CodeGroup>
  ```javascript Node.js SDK theme={null}
  import Intelliprint from 'intelliprint'

  const ip = new Intelliprint('your-api-key-here')

  import fs from 'fs'

  const printJob = await ip.prints.create({
    template: 'tmpl_1234567890', //The ID of the template you want to use. // [!code ++]
    recipients: [{
      address: {
        name: 'John Doe',
        line: '123 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      },
      variables: { // [!code ++]
        salutation: 'Mr.', // [!code ++]
        qr_value: 'https://customlink.com' // [!code ++]
      } // [!code ++]
    }],
    confirmed: false //Set to 'true' when you're ready to start submitting mail for printing.
  })

  console.log('Print job created:', printJob.id)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.intelliprint.net/v1/prints \
    -H 'Authorization: YOUR_API_KEY' \
    -d 'template=tmpl_1234567890' \
    -d 'recipients[0][address][name]=John Doe' \
    -d 'recipients[0][address][line]=123 Main Street, Anytown, Anyplace' \
    -d 'recipients[0][address][postcode]=AB1 2CD' \
    -d 'recipients[0][address][country]=GB' \
    -d 'recipients[0][variables][salutation]=Mr.' \
    -d 'recipients[0][variables][qr_value]=https://customlink.com' \
    -d 'confirmed=false'
  ```
</CodeGroup>
