Developer forum

Forum » Development » Render Global Page in Email on OrderCompleted

Render Global Page in Email on OrderCompleted

Kasper Vesth
Reply

We have a webshop where people internally in the company can order new office supply. As part of this when they choose a Mobile phone they have to enter whether they want to have an old number transferred as part of the checkout. These extra informations are inserted via RenderPageContent in Razor during the checkout and is working fine. The problem comes when we want to show it on their receipt email.

We are using a OrderCompleted NotificationSubscriber to send the receipt, and when we do (this doesn't work either when we use DW's internal mail confirmations):

Template template = new Template("eCom/Cart/OrderShopEmail.cshtml");
renderer.RenderOrder(order, template);

But apparently this does not render GlobalTags, because the content from the other pages are not rendered at all. I know that the Newsletter V3 module, which is not in the context of a page, has the ability to render a pages content and use it to send the email, so my question is:

How would I go about getting the correct content out? If it is necessary I can also make a Page in DW that we can render to act as the confirmation email instead of just using a Template, but I can't seem to get it to work.


Replies

 

You must be logged in to post in the forum