Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Item.Area tags - not working in e-mails

Item.Area tags - not working in e-mails

Mads Poulsen
Mads Poulsen
Reply

Hi, 

We have a problem with Item.Area tags not working in order-confirmation e-mails + online marketing e-mails, where we can't use Item.Area tags.
- It is a pretty big problem specially in order confirmation e-mails.

It have worked in previous versions of DW, and we have used it in plenty of solutions in the past.


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Mads

Area and its item template tags is in the context of a pageview and a layout template - and since an order confirmation email is not send in the context of a pageview and a layout template, I should never have been able to work.I just tested this on a DW8, and I can confirm that is the case.

If you used previously a HTML based template and has now shifted to Razor, that could explain it. Because of the way html templates are rendered, you could get html tags to work in other contexts than the one they were in.

The solution is that you can use the API in Razor templates - Razor templates run on base class (RazorTemplateBase<>) - it has a PageView property which will hold an instance of the pageview rendering your i.e. receipt - so you can do like this: Pageview.Area.Item["GeneralLogo"] to get hold of your item property.

In your online marketing mails, which are pages using a layout template, I am sure you have the Area.Item tags available. If you are in one of the templates for one of the modules on the page, you have to use the approach mentioned above.

Hope this clarifies and explains. Please let me know if you can get this to work or you need more input.

BR Nicolai

Votes for this answer: 1
 
Mads Poulsen
Mads Poulsen
Reply

Hi Nicolai 

Thanks for the answer, this seems to be working just fine 👍🏼

Have a nice day

// Mads

 

You must be logged in to post in the forum