CMS Development

SStrachan1
Participant

Help with programmable email and crm_object

SOLVE

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>

 

 

1 Accepted solution
SStrachan1
Solution
Participant

Help with programmable email and crm_object

SOLVE

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.

View solution in original post

2 Replies 2
RZhukov
Member

Help with programmable email and crm_object

SOLVE

I also need programmable mail and crm_object for my site https://factordedicatedteams.com/hire-dedicated-cms-developers/. Can anyone help me?

0 Upvotes
SStrachan1
Solution
Participant

Help with programmable email and crm_object

SOLVE

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.