I am trying to pass the ID of an object with the transactional email API.
I cannot save my programmable email module because of this error:
Missing required input parameters. Object id or query is mandatory for crm_object function.
My object ID will be “custom.yacht” passed via API. Why is this not valid? Should it be written another way?
{% set yacht = crm_object("yacht", custom.yacht, "name,builder, year") %}
<h1>{{ yacht.name }}</h1>
I also need programmable mail and crm_object for my site Hire Dedicated CMS Developers in 2024. Can anyone help me?
I figured it out. You have to add the filter |int to custom.yacht
from this:
{% set yacht = crm_object("yacht", custom.yacht, "name,builder, year") %}
<h1>{{ yacht.name }}</h1>
to this…
{% set yacht = crm_object("yacht", custom.yacht|int, "name,builder, year") %}
<h1>{{ yacht.name }}</h1>
since custom.yacht is a string you have to filter it as a number.