{{CurrentUser}} template is being rendered as [object Object]

I have a button that will send an email when it’s clicked.

I’m trying to get the email signature of the person who clicked the button to be appended to the end of the email that gets sent.

When I try to use {{CurrentUser.Signature}} in the email markdown, it gets rendered as “[object Object]”, but when I use something like {{CurrentUser.Email}} it renders the field just fine.

My signature field is a rich-text field, whereas the email field is text. Is it something simple I’m missing or not understanding?

Is “Signature” a field in the User DB?


Here’s the settings I’m using for the button/email too:

1 Like

This is a bit awkward, but it works for me:

const rtfield = 'Signature'    // Name of User Rich-Text field
const fibery = context.getService('fibery')
const secret = args.currentUser[rtfield].Secret
const content = await fibery.getDocumentContent(secret, 'md')
%><%= content %>

Does emailing via Fibery works well for you? We don’t use it yet but thinking about using it :smile:

It is not possible using markdown to get the contents of rich text fields from related entities (only from rich text fields from the triggering entity) sorry.

Emails from Fibery work well for us. We’ve created a support@company.co account and send a good amount of automated and custom emails.

Of course, yes, would love more Markdown and traversal options. Always. :wink:

1 Like

This totally works, thanks so much!

I really need to start learning how to script things myself…

1 Like