10.0: Replace snippets with a fully customizable draft generator using interactions #16
jstanden
started this conversation in
Guides and Tutorials
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Let's assume your team composes and replies to clients daily using a couple different snippet templates. That works great if all you need to do is paste some text into the current message.
However, you may find yourself also wanting to associate other presets with each template, like: group/bucket, status, waiting until time, custom fields, formatting, attachments, and so on.
With Cerb 10, you can use interactions to generate a draft and instantly resume it. That gives you full control over every aspect of the draft.
In this guide we'll create an interaction shortcut on a workspace that generates a draft with presets.
Import the example package
Navigate to Setup -> Packages -> Import.
Paste the following package:
Click the Import button.
Add the interaction to your workspace
If you have an existing dashboard you'd like to use, you can navigate there and skip the next step.
Create a new workspace and dashboard
Navigate to Search -> Workspace Pages -> (+).
Select Empty Workspace from the library.
Set the owner to yourself for a private workspace, or Cerb for a shared one (or a role/group).
Name the workspace
Compose
.Click the Create button.
Filter the pages worklist with:
sort:-updated
Click on the new Compose page to open it.
Click on the Add button to create a new tab.
Select Dashboard from the library.
Name the new tab
Templates
.Click the Create button.
Import the widget
Click the Add Widget button.
Select the Import tab.
Paste the following widget:
Click the Save Changes button.
Using the interaction
Click the Compose button to start the interaction.
Select the type of message to send:
The compose editor will open with several presets:
This could also include any other draft field.
From there you can finish the draft and send it.
As an interaction, you can also prompt for worker input before the draft is created and after the message is sent. You can provide inputs based on the current record being viewed.
For instance, if the compose button is on a card or profile (email, contact, org) you can also default the 'To:' and 'Org:' fields, and start the message with "Hello
{{first_name}}
".How it works
Navigate to Search -> Automations.
Edit the wgm.example.draft.generator automation.
First, the interaction prompts the worker to choose a message type ("welcome letter" or "call follow-up") in
await/type
. These are just examples that you can modify to meet your needs.The choices are displayed as a sheet and the worker's selection is saved as the
prompt_type
placeholder.After the worker makes a selection, the
decision
runs different logic depending on their choice. Theoutcome/exampleWelcome
andoutcome/exampleFollowup
outcomes use record.create to create a draft record.The draft is then resumed by the
await/draft:
state, which opens the compose editor and starts a continuation to wait for the response.Finally, if the draft was sent (
compose.sent
) or saved (compose.draft
), the corresponding message or draft record is displayed in another sheet with a link to its card.Customizing the interaction
Add new message types (presets) to the
data:
property insheet/prompt_type:
near the top of the automation.For each message type, add an
outcome/:
to the followingdecision:
. Like the current examples, this should compare theprompt_type
to thekey
of your message type. From there you can customize the default fields for a new draft of that type.That should be it!
You can use the same approach for reply presets on ticket record profiles.
Beta Was this translation helpful? Give feedback.
All reactions