Skip to content

Advanced

Sending Bulk Mail

You can send letters or postcards to thousands of recipients at once.

On this page

Providing Multiple Recipients

To send a print job to many people, provide a recipient object for each of them in the print job.

Node.js SDK
Node.js
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)

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

Node.js SDK
Node.js
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

Node.js SDK
Node.js
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

Node.js SDK
Node.js
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)