Help displaying module fields within if statement in email template
SOLVE
I have a custom module with a handful of fields that I want to use to conditionally include an HTML block in an email template.
The first field in the module is a boolean -> display_client_manager_message
If that is set to true in the email editor, we present the editor with three fields to edit a custom message:
client_manager_message -> rich_text
client_manager_name -> text
client_manager_title -> text
The if condition works nicely and I can get the code block within the statement to conditionally display. But I can't get the value of the module fields to display within the block no matter what I've tried from examples in docs, or pasting the snippet from the module editor in the Design Manager...
Help displaying module fields within if statement in email template
SOLVE
Hey @farser , with the way you have this written (using widget_data) I'm under the impression you aren't writing the code block within the custom module itself? If not then the reason your content isn't showing is because you aren't using the widget_data format on them.
I would just put the code in the custom module itself though instead of using export_to_template_context. It would be a lot cleaner that way. So in the HTML section of your custom module you would put :
Help displaying module fields within if statement in email template
SOLVE
Hey @farser , with the way you have this written (using widget_data) I'm under the impression you aren't writing the code block within the custom module itself? If not then the reason your content isn't showing is because you aren't using the widget_data format on them.
I would just put the code in the custom module itself though instead of using export_to_template_context. It would be a lot cleaner that way. So in the HTML section of your custom module you would put :