CMS Development

Manobyte
Colaborador(a) | Parceiro Diamante
Colaborador(a) | Parceiro Diamante

crm_associations dont seem to pull inside emails

resolver

Im trying to pull custom objects associated to contacts in an email. And I have confirmed that my code is working on regular pages, but it is blank when I put the module in an email. So im wondering, does the {{ crm_associations() }} function not work in emails? or is there a different way to pull that information. 

1 Solução aceita
Manobyte
Solução
Colaborador(a) | Parceiro Diamante
Colaborador(a) | Parceiro Diamante

crm_associations dont seem to pull inside emails

resolver

An update on this, I tryed using the crm_associations() call with a static ID rather then the personalization token ID, and it did return the expected values. I then found someone with a similar porblem on the developer slack that sugested not using the personalization token, but rather just using the 'contact.hs_object_id' right in the association call like this:

  • {% set associated_objects = crm_associations(contact.hs_object_id, "USER_DEFINED", 18, "limit=20&orderBy=-weekly_pay", "company,connect_url,title,description,weekly_pay,start_date,end_date,shift_length,address,city,state,zip") %}

And this has worked for me!

Exibir solução no post original

0 Avaliação positiva
5 Respostas 5
Manobyte
Solução
Colaborador(a) | Parceiro Diamante
Colaborador(a) | Parceiro Diamante

crm_associations dont seem to pull inside emails

resolver

An update on this, I tryed using the crm_associations() call with a static ID rather then the personalization token ID, and it did return the expected values. I then found someone with a similar porblem on the developer slack that sugested not using the personalization token, but rather just using the 'contact.hs_object_id' right in the association call like this:

  • {% set associated_objects = crm_associations(contact.hs_object_id, "USER_DEFINED", 18, "limit=20&orderBy=-weekly_pay", "company,connect_url,title,description,weekly_pay,start_date,end_date,shift_length,address,city,state,zip") %}

And this has worked for me!

0 Avaliação positiva
fregini
Participante | Parceiro Diamante
Participante | Parceiro Diamante

crm_associations dont seem to pull inside emails

resolver

I was not able to make it work, In only one case I've got an object representing an empty list while I had items in the association, I've tried with different association ids from the schema. In other cases even though the UI in the design tools was not showing error (it shows error on the line with  crm_associations if the property is not found on the association) I've got a null in return. 

 

Any clue about what I may be doing wrong?

0 Avaliação positiva
Jaycee_Lewis
Gerente da Comunidade
Gerente da Comunidade

crm_associations dont seem to pull inside emails

resolver

Hey, @Manobyte! Thank you very much for sharing your solution here with the community 🧡 — Jaycee







HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.


Learn More.





Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Avaliação positiva
Jaycee_Lewis
Gerente da Comunidade
Gerente da Comunidade

crm_associations dont seem to pull inside emails

resolver

Hi, @Manobyte 👋 Thanks for reaching out! Can you share a code block or example? This helps the community to better understand possible root issues.

 

Hey, @jolle @Anton @Jake_Lett, do you have any tips or thoughts you can share with @Manobyte?

 

Thank you! — Jaycee







HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.


Learn More.





Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Avaliação positiva
Manobyte
Colaborador(a) | Parceiro Diamante
Colaborador(a) | Parceiro Diamante

crm_associations dont seem to pull inside emails

resolver

I pull the ID using the personalization_token(), and this works just fine, but the 2nd part for the crm_associations() returns nothing, dispite it working just fine on a webpage, and previewing as a contact that has the association.

{% set contact_id = personalization_token('contact.hs_object_id', '') %}
{% set associated_objects = crm_associations(contact_id, "USER_DEFINED", 18, "limit=20&orderBy=-weekly_pay", "company,connect_url,title,description,weekly_pay,start_date,end_date,shift_length,address,city,state,zip") %}

0 Avaliação positiva