OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums Forums OroCommerce Customized Email Template

This topic contains 7 replies, has 2 voices, and was last updated by  aman.srivastava462 8 months, 3 weeks ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #41156

    aman.srivastava462
    Participant

    I want to add my own entity and variable according to this in the email template. please check the screenshot https://prnt.sc/qfw8b8.
    can I customize it? is there any doc so I can customize this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #41162
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    To make entity available for email templates you need to make it configurable with the @Config annotation.

    #41168

    aman.srivastava462
    Participant

    Thanks for the reply,
    yes entity is added but when I am using these variables https://prnt.sc/qge342, for email template while compiling template from entity I am always getting error like
    Calling “getrating” method on a “MarketplaceBundle\Entity\SellerReview” object is not allowed in __string_template__93a32a6beb3f031f07f373abf42c592ed96c1f756a1e43341af9dc9acc0786bf at line 8.

    #41169
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Please share the syntax of how do you access this variable in a template and the implementation of a getter method for the property you are working with.

    #41173

    aman.srivastava462
    Participant

    I am using like this https://prnt.sc/qgeh0f
    and
    in code, I have added this

    #41174
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    I see that “seller” property value is an object, so it may be an issue that twig doesn’t know how to render that. But as for the “rating” property that is mentioned in an error message, there is nothing special, so it’s hard to say without debugging.

    #41182

    aman.srivastava462
    Participant

    if I am not using the seller even then it is now working, I am also not getting those values that are not objects if I need to debug so could you please let me know how can I debug it.
    which method is calling from the template.

    #41193

    aman.srivastava462
    Participant

    Hello Andrew Yatsenko’s,

    I have found the solution with the help of this doc,

    https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/EmailBundle/Resources/doc/email_templates.md

    please add this in your document, so users can easily find this.

    Thanks for your help,

    Regards,

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

The forum ‘OroCommerce’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No