Re: Component based email without a context
Re: Component based email without a context
- Subject: Re: Component based email without a context
- From: Ken Anderson <email@hidden>
- Date: Sat, 29 Oct 2011 08:12:43 -0400
Thanks Paul. Unfortunately, currentContext() will return null, since this will not be running inside a request/response loop. I'm probably just going to create a context to useā¦
Ken On Oct 28, 2011, at 6:51 PM, Paul Hoadley wrote: Hi Ken, On 26/10/2011, at 11:40 PM, Ken Anderson wrote: I would like to be able send emails generated by components in the background without a user (or a context).
Does anyone have a chunk of code for creating a WOContext to be populated for generating email from a WOComponent?
This is how I do it (Wonder-based app):
SomeEmailComponent component = ERXApplication.erxApplication().pageWithName(SomeEmailComponent.class, (WOContext) ERXWOContext.currentContext().clone());
Then later:
ERMailDeliveryHTML mail = new ERMailDeliveryHTML(); mail.setComponent(component);
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden