• Welcome to KonaKart Community Forum. Please login or sign up.
 

Accessing KKEng in Velocity

Started by mtoon, May 12, 2008, 01:59:08 am

Previous topic - Next topic

mtoon

Is there any handle to the KKEng object from within the Velocity templates?

heidi

Objects are only accessible if placed within the Velocity context.  I don't think we put KKEng in any of the velocity contexts in the main product.

Heidi

julie

The Admin API has a method called

void sendTemplateEmailToCustomers(java.lang.String sessionId,
                                  AdminCustomerSearch custSearch,
                                  java.lang.String templateName,
                                  java.lang.Object obj1,
                                  java.lang.Object obj2,
                                  java.lang.Object obj3,
                                  java.lang.Object obj4,
                                  java.lang.Object obj5,
                                  int numEmailThreads)

Using this API call you can pass in up to 5 user defined objects, the name of the template and a customer search object to determine which customers the eMail is sent to. Note that if using the SOAP API, a variation of this method needs to be used. See the javadoc for details.

How would you use the KKEng object if it were there ?


mtoon

We descended from the KKEng class and added our own properties to it.  I'd like to access these properties in the velocity templates in the application, not the admin (yet).

How do I add the KKEng object to the context?

Thank you!

julie

You can't !

If you want to do something very custom, what I suggest is to manage Velocity yourself in order to generate the message. Once you've done that, you can use :

public void sendTemplateEmailToCustomer(int customerId, String templateName, String message,
            String countryCode) throws KKException;

to actually send the mail. The template could be just a placeholder for the message which you generated using your own velocity template.

mtoon

What version is that in, i couldn't find the method you described in the admin, client or server documentation for 2.2.2.0... 

julie