access of user.setting in email template

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
Tea-Dev
Lieutenant (LT)
Lieutenant (LT)
Posts: 55
Joined: Wed Oct 12, 2011 11:15 am

access of user.setting in email template

Post by Tea-Dev » Sat May 18, 2013 5:21 pm

i want to save a customer's fedex number in user setting and then make available to send to vendor.
can you access/display user.setting field in email templtes? if so, how? thanks.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: access of user.setting in email template

Post by jmestep » Mon May 20, 2013 5:43 am

Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: access of user.setting in email template

Post by AbleMods » Mon May 20, 2013 5:49 am

Yes it is definitely possible. You can loop through all UserSettings and identify the one you want to render.

Just do it this way:

Code: Select all

#foreach($setting in $order.User.UserSettings)
#if ($setting.FieldName=="Test")
$setting.FieldValue
#end
#end
It looks a bit clunky, but nVelocity has never been known for it's intuitive code formatting and syntax ;)
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: access of user.setting in email template

Post by mazhar » Mon May 20, 2013 10:35 am

You can do it like

Code: Select all

$user.Settings.GetValueByKey("FieldName")

Post Reply