ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 3 replies, has 2 voices, and was last updated by  Manuel Capinha 1 month, 3 weeks ago.

  • Creator
    Topic
  • #35522

    Manuel Capinha
    Participant

    Hi,

    I’ve setup a custom Opportunity workflow that sends emails at certain steps.
    On one of these steps I have to send an email containing information stored in the Account Entity, namely its name.

    My twig template is very simple:

    Entity is my Opportunity Entity and I can access its attributes with no problem. But trying to access entity.customerAssociation.account always throws an error:

    How can I access Account attributes from inside an action that sends email with send_email_template ?

    Regards,
    Manuel

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #35533
    msulima
    msulima
    Oro Core

    Hi, Manuel Capinha.

    Can you provide configuration of your workflow and email template?
    Also, now I try to reproduce your issue to provide way to resolve it.

    #35535
    msulima
    msulima
    Oro Core

    I reproduced this issue. Created bug in our backlog (Internal ID: BAP-15117).

    Email rendered in twig sandbox and only allowed methods can be used inside.
    For unknown reason field of Opportunity entity not in list of allowed properties from default provider.

    For now you can try add new provider that should implement Oro\Bundle\EmailBundle\Provider\EntityVariablesProviderInterface and tag { name: oro_email.emailtemplate.variable_provider, scope: entity } and true to add required method to list of allowed methods of entity Oro\Bundle\SalesBundle\Entity\Customer.

    Thank you for reporting issue.

    #35539

    Manuel Capinha
    Participant

    Hi MSulima,

    I’ve been digging around and it seems that getVariableGetters() isn’t being called with Oro\Bundle\SalesBundle\Entity\Customer as parameter.
    I’ve managed to workaround it by directly injecting the needed methods in configureSandbox()..

    But most of the problem remains as I still can’t access extend attributes of my Account Entity, since their getter methods ain’t visible in the Account class :/

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.