Skip to main content

Providing Multiple Recipients

To send a print job to many people, provide a recipient object for each of them in the print job.
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!',
  recipients: [
    {
      address: {
        name: '1: John Doe',
        line: '123 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      }
    },
    {
      address: {
        name: '2: Hopper Doe',
        line: '456 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      }
    },
    {
      address: {
        name: '3: Jane Doe',
        line: '789 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)
You can design a template with dynamic fields (variables) in the Intelliprint Dashboard if you would like to customise your mailings for each recipient.

Using a Mailing List

Sometimes you may want to send the same print job to the same recipients multiple times. In this case, you can use a mailing list to store the recipients and then send the print job to the mailing list.

Creating a Mailing List

import Intelliprint from 'intelliprint'

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

const mailingList = await ip.mailing_lists.create({
  name: 'My Mailing List',
  recipients: [
    {
      address: {
        name: 'John Doe',
        line: '123 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      },
      variables: {
        employee_id: '123456'
      }
    }
  ]
})

console.log('Mailing list created:', mailingList.id)

Adding Recipients to a Mailing List

import Intelliprint from 'intelliprint'

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

const mailingList = await ip.mailing_lists.update('my-mailing-list-id', {
  delete_old_recipients: false,
  recipients: [ // The following recipients will be appended to the mailing list.
    {
      address: {
        name: 'John Doe',
        line: '123 Main Street, Anytown, Anyplace',
        postcode: 'AB1 2CD',
        country: 'GB'
      },
      variables: {
        employee_id: '123456'
      }
    }
  ]
})

Sending a Print Job to a Mailing List

import Intelliprint from 'intelliprint'

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

const printJob = await ip.prints.create({
  template: 'tmpl_design',
  mailing_list: 'mal_example',  
  confirmed: false //Set to 'true' when you're ready to start submitting mail for printing.
})

console.log('Print job created:', printJob.id)
Mailing Lists are limited to 100,000 recipients. Contact Intelliprint Support if you want this limit increased for your account.