Include attachments with Courier

Prev Next

Courier can attach files to the emails it sends. This page explains where Courier gets the files, how it decides which files go with which email, and the limits that apply. You set up a configuration's attachments on its Email Attachments tab in the Courier configurator.

Kinds of attachments

  • Generic attachments—up to five files stored with the configuration itself, such as a price list or a blank form. Courier adds the same files to every email the configuration sends.

  • Files from Quickbase file attachment fields—files that belong to a record, such as an invoice PDF. Courier finds them separately for each record it emails, so each recipient gets their own files.

  • Files from Amazon S3—files stored in your Amazon S3 bucket, referenced by an S3 key saved in a text field on a record. Courier downloads them for each record, the same way as file attachment fields.

Which records the files come from

For files from file attachment fields and Amazon S3, each attachment setting points to a table in the configuration's Quickbase app. For every record it emails, Courier looks up files in that table:

Table

Records Courier takes the files from

The configuration's own table

The record being emailed.

A related child table (with a reference field to the configuration's table)

All child records of the record being emailed. If the setting has query criteria, only the child records that also match the criteria.

Any other table

The records whose field to match equals a value from the record being emailed (field value to match). If the setting has query criteria, only the records that also match the criteria.

  • Courier attaches the files from every matching record and every selected field. Empty fields are skipped.

  • Query criteria use the Quickbase query format, for example {'14'.EX.'Invoice'}. Courier combines them with the relationship or match filter using AND, without parentheses—so if your criteria contain OR, wrap them in parentheses yourself, for example ({'14'.EX.'Invoice'}OR{'14'.EX.'Quote'}). Field names in square brackets aren't replaced in attachment criteria. See Components of a query.

Files from Amazon S3

  • Courier downloads the files from the Amazon S3 bucket and with the credentials set up for your account; see Amazon S3 setup. It finds the bucket's region automatically.

  • The file's path in the bucket is the value of the S3 key field. If the setting also uses a folder field, the path is <folder>/<key>.

  • Courier names each S3 attachment from the file's filename metadata in Amazon S3. Files uploaded to S3 without that metadata can't be attached.

  • Records with an empty S3 key field are skipped.

Order and file names

  • Order—files are added in the order of each setting's attachment order (1–10, lowest first). Generic attachments come last.

  • Names—files from Quickbase keep their file name (special characters encoded in the URL, such as %20, are decoded). Files from Amazon S3 use their filename metadata.

  • Duplicate names—when two files for the same email have the same name, the second can overwrite the first unless the configuration renames files. With renaming on, Courier adds a number to each duplicate, for example Invoice.pdf, Invoice_01.pdf, Invoice_02.pdf. Renaming applies to files from tables and Amazon S3, not to generic attachments.

Limits

  • Files per email—each configuration has a file attachment limit (default 5, shown in the configurator under View Limits as Maximum # of Attachments for each email sent). It counts the files Courier finds in tables and Amazon S3 for each email; generic attachments aren't counted. If a record has more files than the limit, Courier doesn't send that record's email and records the error in the configuration's activities.

  • Size—Courier doesn't limit the size of attachments or zip them, but mail servers have their own limits. Very large emails, or emails with many attachments, can be rejected by the sending mail server or blocked by the recipient's. Keep attachments as small and as few as you can.

Attachments and processing modes

  • Trigger—Courier attaches the files for the one record that fired the notification.

  • Scheduled and On Demand—Courier reads the records from the configuration's report, then finds the files for each record. The report must include the S3 key fields used from the configuration's own table and every field used as a field value to match. If one is missing, the configuration's activities show The following fields are missing in the report used to select the data for the message.

  • Test Mode and the Test Configuration tab—the sample email includes the generic attachments and the files of the first record only.

What's recorded

  • If the configuration keeps a local activity log in your Quickbase app, each activity record can store a zip of the files that were attached and the number of files.

When an attachment can't be added

If Courier can't get an attachment for a record, it doesn't send that record's email. The configuration's activities show the reason in Processing Details:

Message

Meaning

Configuration is exceedling your File Attachment limit set to attach with emails! You can only send out N file attachment files with emails!

The record has more files than the configuration's limit. Narrow the attachment settings with query criteria, or ask for a higher limit.

Missing required information in the email attachment configuration.

An attachment setting is missing its table or fields.

Error occured while downloading email attachments - …

Courier couldn't download a file from Quickbase—for example, a field was deleted or the query criteria aren't valid.

Missing S3 Credentials… or Unable to download file from S3…

The Amazon S3 credentials or bucket are missing or wrong, or the S3 key and folder values don't point to an existing file.

For other problems, see Courier troubleshooting.