Skip to content

*SendBetterEmail* - _Flow Action_ - Task Created on Related Record Even When Save Email as Task Is Disabled #1701

@igorszymonczyk

Description

@igorszymonczyk

How to use GitHub

Bug report submitted after full reproducibility testing in Salesforce Flow.


Steps to reproduce

  1. Add SendBetterEmail action inside a Record-Triggered Flow.

  2. Configure the action with:

    • Save Email as Activity on Recipient Record = TRUE
    • Save Email as Task on recipient related record = FALSE
    • Related Record ID = Case Id
    • Email Template Id = populated
    • Subject = blank (to allow Email Template Subject to be used)
  3. Trigger the Flow so the email is sent.


Expected result

  • Email sends successfully using Lightning Email Template subject/body.
  • EmailMessage activity is logged.
  • No Task record should be created on the Related Case because Save Email as Task on recipient related record is disabled.

Actual result

A Task record is still created on the Related Case.

Because Subject is intentionally blank in the Flow Action, the generated Task is logged with:

Subject = "Sent Email: null"


Additional troubleshooting already performed

Scenario 1 — Populate Subject in Flow Action

If Subject is populated manually in SendBetterEmail:

  • Task no longer shows "null"
  • but Lightning Email Template content is no longer respected correctly and a blank email body is sent.

Scenario 2 — Remove Related Record ID

If Related Record ID is removed:

  • Task is not created
  • however Email Template merge fields based on Case object (example: {!Case.CaseNumber}) no longer resolve.

This indicates that providing Related Record ID may be internally forcing Task creation regardless of the Save Email as Task flag.


Questions / Suspected Bug

  • Is Task creation implicitly tied to RelatedRecordId in the current Apex implementation?

  • Should Save Email as Task = FALSE suppress all Task creation?

  • Is there a supported way to:

    • keep Related Record ID for template merge fields,
    • log EmailMessage activity only,
    • and prevent Task creation?

Salesforce Environment

  • Salesforce Edition: Enterprise Sandbox
  • Flow Type: Record-Triggered Flow
  • Object: Case
  • Email Template Type: Lightning Email Template

Package Version

Package Version

3.18 (FlowActionsBasePack / UnofficialSF / namespace usf3)
Issue reproduced on FlowActionsBasePack version 3.18.
Please let me know if this behavior was addressed in any later release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions