Forums OroPlatform OroPlatform – How do I? Questions OneToMany relations in email templates

This topic contains 6 replies, has 3 voices, and was last updated by  Artem Liubeznyi 1 year, 6 months ago.

  • Creator
  • #30519

    Kadir Yücel

    How can I access addresses or order items of entity “Magento Order” in email templates? Realtions “oneToMany” are not accessible.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
  • #30520

    Artem Liubeznyi

    Hi Kadir,

    We currently do not support one-to-many relations because there is no way to specify the exact order you want to include into the template.

    One possible solution is to base your template on the Magento Order entity. You will be able to use its address and access customer details via relations too.

    Will this solve your use case?


    Kadir Yücel

    Thank you Artem for you quick response.

    I can access the customer entity but this not the same like billing and shipping addresses saved in order (table orocrm_magento_order_address). Furthermore I want to list the purchased items for information or invoice purpose.

    Are there any tricks to do that?


    Kadir Yücel

    What about extending this config with “oneToMany”


    Artem Liubeznyi

    I am not sure about the results of such expansion; most likely, the variable will return only the first address in the collection, but there will be no way to distinguish billing and shipping addresses, nor guarantee that a specific address type will be returned.

    Looks like we need to extend our template capabilities to properly handle one-to-many relations. I will add this feature to our backlog, thank you very much for the heads up. I’ll keep you posted about the implementation progress, too (no idea on the timeline yet though).



    Hi, is thereany news about this feature?

    i’ve created an email template associated to “Order” entity but i get:

    Calling “getlineitems” method on a “OroB2B\Bundle\OrderBundle\Entity\Order” object is not allowed

    How can i access this method in the template? I see that “lineItems” are not displaying in the “Entity variables” tab.

    Here says that “All fields that available in email templates stored in EntityConfigBundle, and can be configured in UI”

    and it’s true, the property “lineItems” is shown on “Entity management” but not in the template.
    How can i access OneToMany or ManyToMany properties on email templates?

    Thanks in advance!


    Artem Liubeznyi

    No news so far; we have the feature in our backlog but don’t have an implementation timeline yet. Please follow our updates.

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

You must be logged in to reply to this topic.