Skip to content

fix(firestore-send-email): kit/extension parity – templates without data render with {} instead of undefined #3301

Open

Description

@CorieW

firestore-send-email kit/extension parity. Priority: low. A template rendered with no data gives different output.

Difference

  • Extension: passes template.data as-is, so undefined when it's missing.
  • Kit: passes template.data || {}. Handlebars then treats the context as truthy and prints it.

Reproduced

Template html IF:{{#if this}}Y{{else}}N{{/if}} THIS:[{{this}}] sent with no data:

  • Extension: IF:N THIS:[]
  • Kit: IF:Y THIS:[[object Object]]

Strict-mode attachment errors also change from "not defined in undefined" to "not defined in [object Object]".

Code

Resolution

Pass payload.template.data unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions