Send email with selected rows as content

I’m sure I’ve done something like this before, but I seem to have lost the recipe. I have a table of drives that require drivers. I want to make it so my user can select multiple drives and then send an email with a summary of each drive opportunity to the drivers. I can make an action to flag the drives that need to be included easy enough, but what I’d like to do is have a single action where after selecting the drives to be included in the email, the user clicks one action and the email is sent.

I think the steps involved are:

  1. update each selected drive record with the send flag set to yes;
  2. trigger a bot to send an email (a select statement in the email template will ensure the right drives are included;
  3. clear the send flags from the drive records.

I don’t remember how it is that something initially intended for multiple records (step 1) turns into a single action (step 2). Perhaps another table is needed where a record can be added which will trigger a bot for steps 2 and 3, but I don’t recall how the action that would create this record would be limited to creating a single record.

I would recommend introducing a “Send Drives” table dedicated to selecting the Drives to send as well as capturing additional details of the send event -dat occurred, recipients, etc. This also provides flexibility in controlling the send event - e.g. manually select the intended recipients or set it to send on a future date, etc.

The advantages are:

  1. It’s clear how to select the Drives to be included - an EnumList column. The biggest challenge might be in showing enough details in the dropdown to help in identifying which rows are to be chosen. I typically build a custom column named Label that concatenates several columns together and then set this as the Table’s Label column - shown on dropdowns.

  2. No need for messy marking/unmarking row logic and have to be concerned about overlap between users performing same function OR rows being left marked and included in subsequent notifications.

  3. You have an explicit row - the Send Drives row - from which to trigger the bot.

  4. You can keep a history of the sent notifications for review/analysis purposes when questions arise.