Developer forum

Forum » Templates » How to work with Receipt.html for ItemCreator

How to work with Receipt.html for ItemCreator

Ton Martens
Reply

Hi,

This is about the template templates/ItemCreator/Email/Reciept.html. It sends a receipt to the creator if the item-type. 

The template just consists of 2 loops, one outer loop for Item.Groups, and one inner loop for Item.Group.Fields.

However, I want a tag of the inner loop (a value of one of the fields of the ItemType) to be available outside the loop. So I can use the value of that field to address the creator nicely.

I know the (system)name of the fields. How can I use these fields directly without the need of looping?

Thanks,

Ton


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Ton

You have all the same tags available as when rendering the item anywhere else...

So you can just add Item.[ItemFieldSystemName] to the template. Or add @DwTemplateTags to get a full list.

BR Nicolai

 
Ton Martens
Reply

Hi Nicolai,

That's the point, @DwTemplateTags doesn't give me a list. It returns nothing. Maybe because it's in an e-mail-template instead of a page template?

Thanks,

Ton

 
Merethe Vrå Andersen
Reply

Hi,

If you convert Receipt.html to razor (you can use the razor converter in the template editor) and use @TemplateTags(), you get the list of tags and loops in the receipt email.

My attached example is the default Receipt template (in razor) with @TemplateTags().

I hope that this is what you need.

Kind regards,
Merethe

creator.png

 

You must be logged in to post in the forum