Keep a record of every email in your own app
Courier can add a record to a table in your Quickbase app for each email it sends. This is the local activity log. Each record shows who the email went to, what it said, when it was sent, which record it was about, and whether sending failed. Because the table is in your app, you can report on it, add it to forms, and keep it as long as you need.
The local activity log is separate from the configuration's Activities in the configurator. Activities show one entry per run, with counts such as emails sent and records bypassed. The local activity log has one record per email.
Turn on the local activity log
On the configuration's Finish tab, in Email Activity, select Add local activity log. Then either choose an existing table or let Courier create one:
Use an existing table—select it in Activity Table, then choose a field for each value you want to keep. Leave a setting as None to skip that value.
Create a table—select Add new activity table. Courier adds an Email Activities table to the app, with a field for each value and a Related <table name> reference field that links each activity to the record that was emailed. It also adds an Email Activities report link to the configuration's table, so each record shows its emails. Courier fills in the field settings for you, except the two attachment settings: select the Email Attachment and Email Attachment Count fields yourself.
When Add local activity log is selected, an activity table is required. If none is selected, the configuration doesn't run, and its activities show the error Missing activity table dbid to insert activity records! Unable to proceed!
What each field records
Setting on the Finish tab | What Courier stores |
|---|---|
Activity to fid | The email's To address. |
Activity from fid | The email's From address— |
Activity CC fid | All CC addresses on the email, separated by semicolons. |
Activity BCC fid | The BCC address entered on the configuration. BCC addresses that come from a field on the record aren't recorded. |
Subject fid | The subject as sent, with field values filled in. |
Body fid | The message as sent, as HTML, with field values filled in and embedded report tables included. Use a multi-line text field. |
Processed time | The date and time Courier sent (or tried to send) the email. To store it in your app's time zone, select Update datetime in QuickBase application timezone on the Email Options tab and also set Activity Related fid; otherwise the time isn't converted to your app's time zone. |
Master table dbid | The table ID of the configuration's table. |
Master recid fid | The Record ID# of the record that was emailed. |
Config name fid | The configuration's name. |
Error details fid | Empty when the email was sent. When sending failed, the error message from the mail server. |
Activity Related fid | The value that links the activity to the record that was emailed: the record's key field value if the table uses a key field other than Record ID#, otherwise its Record ID#. Use a reference field related to the configuration's table. |
Activity File Attachment fid (first) | A zip file with all the files attached to the email. Use a file attachment field. Left empty when the email had no attachments. |
Activity File Attachment fid (second) | The number of files attached to the email. |
Courier doesn't currently fill in Email messageid fid or Activity Mail Server from fid. You can leave them as None.
When Courier adds an activity record
Courier adds one activity record for each record it emails when the configuration runs live (enabled and not in Test Mode), in every processing mode—Scheduled, On Demand, and Triggered.
Email sent—an activity record is added with an empty error details field.
Sending failed—an activity record is still added, with the mail server's error in the error details field. If an Office 365 refresh token has expired, Courier records the failed email and doesn't process the rest of the records in that run. See Courier troubleshooting.
Courier doesn't add an activity record when:
The configuration runs in Test Mode. The test email isn't recorded.
A record is skipped before sending, for example because its attachments couldn't be downloaded or an embedded report couldn't be built. See Include attachments with Courier.
The email was sent, but Courier doesn't have enough permission to write to the activity table.
A problem with the activity table doesn't stop the email—it's still sent. The configuration's activity for that run shows Unable to insert local activity record followed by the error from Quickbase. Only the first such error in a run is shown. Check that Courier can add records to the activity table and that every mapped field still exists and has a suitable field type.