cancel
Showing results for 
Search instead for 
Did you mean: 

How can i check if the custom field populated to email conformation context ?

former_member634278
Participant
0 Kudos

Hello,

How can i check if the custom field populated to email conformation context "email body" ? I have created new attribute in delivery address form and i want to retrieve it into email body of email conformation context. it always giving me the same name of the attribute ${ctx.order.deliveryaddress.newattributebname}.

I have another question regarding to check the parameters in vm. for e.g. if i want to check is the field empty or not i can use if(${ctx.order.deliveryaddress.newattributebname}!="") , or , if(${ctx.order.deliveryaddress.newattributebname}) , or , if(${ctx.order.deliveryaddress.newattributebname.isEmpty()) ... What is the difference between them?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

please make sure that in your context the order value and in order object deliveryaddress and in deliveryaddress newattributebname has been set properly or not. This one you can print in your context class. If this value printed from yoru email context class then it should appear in your vm file.

Null check can be done as given below

if(${ctx.order.deliveryaddress.newattributebname} != $null)

${ctx.order.deliveryaddress.newattributebname}