How to set a default BCC email address?
Your business may require to send copies of the invoice email to specific recipients – your sales department or the accounting division, for example. To this end, you pre-populate the Email BCC
field of invoices.
There are, basically, two ways to do so:
- Setting an
ON_EmailBCC
field on the invoice source record, or - Using a dedicated flow.
Using ON Field
The ON field mechanism is the "JustOn way" for setting certain fields. To pre-populate the invoice Email BCC
field, you add the custom field ON_EmailBCC
to the source record for the invoice – if you create invoices from subscriptions, to the subscription, and in case of the generic invoice run, to the relevant source object.
- Navigate to the fields list of the relevant object.
-
Create the following new field.
Field Label API Name Data Type Email BCC ON_EmailBCC Formula (Text) For help about creating fields, see Managing Object Fields.
Depending on your requirements, you can use a formula that directly specifies one or more addresses or one that chooses an address based on specific criteria. Once set, JustOn copies the value to the invoice
Email BCC
field upon invoice creation via invoice run.
Using Flow
Alternatively, you can use a dedicated Salesforce flow to have the invoice Email BCC
field set on invoice creation.
- Click to enter Setup, then navigate to Process Automation > Flows.
- Click New Flow.
-
Select
Record-Triggered Flow
and click Create.The minimum required flow elements include:
Flow Element Option Value Start Object Invoice
Trigger A record is created
Optimize for Fast Field Updates
Update Records How to Find Records to Update Use the invoice record that triggered the flow
Filter Conditions None--Always Update Record
Field ONB2__EmailBCC__c
Value email address, enclosed in double quotes
or
variable to determine the required email addressSpecify node labels and API names as required.
Depending on your use case, the flow setup will vary. You may need, for example, start node conditions or a decision node to determine whether to set the Email BCC field.
-
Click Save.
Specify a flow label and API name as required.
-
Click Activate.
This makes Salesforce trigger the flow when an invoice record is created, setting the
Email BCC
field based on your conditions.