Welcome to the THELIA support and discusssion forum


Rejoignez la communauté sur le Discord Thelia :


my goal is to render a html content (user's order custom message) in email confirmation and notification template.

Having hook setup in module config.xml like this:

<hook id="" class="OrderComment\Hook\EmailHook">
 <tag name="hook.event_listener" type="email" event="email-html.order-confirmation.before-products" method="onOrderConfirmation"/>

and module template like this:

{loop type="order.comment.comment" name="order_comment_loop" order_id="$order_id"}
        <strong>{intl l="Observations" d=""}</strong>:<br />
        {$ORDER_COMMENT|nl2br nofilter}

In final received email I got duplicated content. One where is

{hook name="email-html.order-notification.before-products" order=$order_id}

which is correct, but another one where:

{hook name="email-html.order-notification.after-address" order=$order_id}

which is not correct.

Final email look like this:

Delivery address:
Mr. David

Billing address:
Mr. David

message 14

Order Total: 15.40 €
Order Number: ORD000000000245
Paid With: Pay by Credit Card
Purchase Date: 11-13-2021 04:24:33
Delivery method: Custom Delivery

message 14

I've removed cache manually and also run  php Thelia hook:clean, but it didn't help.

Thanks in advance for any suggestions.

Last edited by davidm (13-11-2021 18:13:22)

Thelia version 2.4.4.


After I added another hook for email-html.order-notification.before-products:

<tag name="hook.event_listener" type="email" event="email-html.order-notification.before-products" method="onOrderConfirmation"/>

it's rendered only once en an email, so problem has been solved. Just don't know how.

Thelia version 2.4.4.