Re: email WOComponent
Re: email WOComponent
- Subject: Re: email WOComponent
- From: Max Muller <email@hidden>
- Date: Mon, 8 Mar 2004 09:52:34 -0800
Hi,
From ERXApplication in ERExtensions:
/**
* Used to instanciate a WOComponent when no context is available,
* typically ouside of a session
*
* @param pageName - The name of the WOComponent that must be
instanciated.
* @return created WOComponent with the given name
*/
public static WOComponent instantiatePage (String pageName) {
// Create a context from a fake request
WORequest fakeRequest = new WORequest("GET", "", "HTTP/1.1",
null, null, null);
WOContext context = application().createContextForRequest(
fakeRequest );
return application().pageWithName(pageName, context);
}
Regards,
Max
On Mar 8, 2004, at 8:39 AM, WebObjects EMail wrote:
> hi!
>
> i start my WO Application.
> at 1 AM sends the app an email on my email address automatically
> firing this
> by
> a Timer.
> to send the email i use this :
>
> EMailBody invoice = (EMailBody)pageWithName("EMailBody");
>
> String from = "email@hidden";
>
> NSArray to = new NSArray("email@hidden");
>
>
>
> // Invoice is a WOComponent
>
>
>
>
>
> WOMailDelivery.sharedInstance().composeComponentEmail(
>
> from,
>
> to,
>
> null,
>
> "Invoice from My Company for " + "Customer Name",
>
> invoice,
>
> true);
>
> System.out.println("Done! ");
>
> return invoice;
>
>
>
> well this is what i want to do. but because i dont have a Request i
> cant use
>
> EMailBody invoice = (EMailBody)pageWithName("EMailBody"); to create the
> invoice WOComponent.
>
>
>
> anybody can tell me how can i create a WOComponent without request?
>
>
>
> thanks in advance
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.