Page 1 of 1

nVelocity usage

Posted: Sat Nov 01, 2008 7:44 am
by jmestep
I've been looking thru the source code to find out how nVelocity has been integrated with Able and possibly how to add other parameters/events. In the StoreEventEngine.cs and ScripletPart.cs, there are references to things like

Code: Select all

  parameters["order"] = order;
            parameters["customer"] = order.User;
            parameters["oldstatusname"] = oldStatusName;
            ProcessEmails(StoreEvent.OrderStatusUpdated, parameters);
Is that where they get integrated with nVelocity? So anything in the classes for store, order, users, products, payments? The Able wiki reference doesn't show events, for example. Is anything in the Stores namespace available for parameter usage?

Re: nVelocity usage

Posted: Mon Nov 03, 2008 6:06 am
by mazhar
One way for custom parameters support in the StoreEngine could be that you write a custom function with one parameter of type hashtable. Then you can call that function of store engine providing it the custom hashtable with parameters. for example

Code: Select all

Hashtable parameters = new Hashtable();
parameters.Add("myuser", Token.Instance.User);
parameters.Add("mycustomint", 123);
StoreEventEngine.MyCustomFunction(parameters)
You can add any ablecommerce object in the parameters. These custom parameters will be available to you when sending the Email. So you can write NVelocity code using these custom parameters inside your template.

Re: nVelocity usage

Posted: Mon Dec 15, 2008 11:48 am
by dnoell
This may be a dumb question but where are StoreEventEngine.cs and ScripletPart.cs located?

Thanks,

David Noell

Re: nVelocity usage

Posted: Mon Dec 15, 2008 12:51 pm
by mazhar
These are classes in API source code.

Re: nVelocity usage

Posted: Mon Dec 15, 2008 12:58 pm
by dnoell
Thank you for your response. I looked through all of the site pages and code and didn't find them. I appreciate the confirmation.

David Noell