Email settings and overrides
Knock email channel configurations support a number of settings. These include email-specific fields (such as cc
, bcc
, and reply-to
) as well as JSON overrides to be passed in API calls to the configured provider's API endpoints.
When you configure a setting in a channel's configuration, it will be used on all instances of that channel across all workflows.
Configuring email settings
You can override email settings on a per-channel basis, or on a per-template basis.
- At the channel level. The
to
,cc
,bcc
, andreply-to
fields can be found in the "Overrides" section of the channel's "Settings" tab. - At the template level. You'll find the email settings under the "Manage template settings" button.
All email configuration fields support Liquid usage. You will be able to use any variables available in your workflow trigger payloads, as well as system variables such as the current workflow, activities, and any other variables you have access to when building templates.
As an example, if you wanted to conditionally change the "From name" on an email depending on whether one is configured on the actor that triggered the notification, you'd use the following liquid in the "From name" field of your email configuration.
to
address
Overriding the default By default Knock will send your emails to the email
property stored on the recipient
for the workflow run. If you need to override this, you can do so by setting the to
field in your email configuration either at the channel or the template level.
As an example, if you wanted to send all emails to a single address, you could set the to
field at the channel level to either a static value (like hello@example.com
) or a dynamic value (like {{ data.email_to_override }}
).
cc
and bcc
addresses
Setting The cc
and bcc
fields can be used to support a single or multiple addresses. In order to use several addresses on any of these fields, make sure to separate them with a comma.
Provider JSON overrides
Sometimes you may want to customize the API call Knock sends to your email provider.
A good example of this is passing custom arguments as part of the API payload.
Take an example where we're using SendGrid as our email provider. SendGrid allows sending custom arguments under the
custom_args
key of the JSON payload of their API. By default, Knock sends some arguments using that key, such
the Knock message id. If you want to add more arguments, you can check the following image on how to add them as
JSON overrides:
In this example, we want to add two arguments to the custom_args
attribute of the API call we send to SendGrid.
In this case, the first argument will be hardcoded, and the second
argument's value will be the value of workflow_variable
, which we expect to be passed
in the payload of the workflow trigger call.