I'm writing a ScheduledJob that is going to send email to users.
The email needs to contain strings from UIManager and URLs
that I would normally generate using $link.
The trouble is that because I will be sending these messages
from a ScheduledJob, data & context are not available.
It looks like I can create a context to pass to VelocityEmail
by going:
Context context = TurbineVelocity.getContext();
and I can get a UIManager using:
UIManager ui = new UIManager();
ui.init(null);
ui.setSkin(); // will use TR.props
but I am not sure about TemplateLink as with no RunData
available I really need a ServletData instance in order to
initialise the TemplateLink instance.
TemplateLink link = new TemplateLink(ServletData);
The only way I can see to get a ServletData object in order
to be able to correctly initialise TemplateLink is to repeat
a bunch of code from TurbineRunDataService - I can do
this, but it seems like I am doing too much and that there
must therefore be an easier way.
Does what I am doing make sense or am I barking mad?
Any help would be appreciated.
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]