• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get html-response inside of component and send it as html-newsletter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get html-response inside of component and send it as html-newsletter


  • Subject: Re: get html-response inside of component and send it as html-newsletter
  • From: email@hidden
  • Date: Fri, 2 Dec 2005 11:26:00 +1300

Hello Ute;

In an action trigger a response, which hands over the html for a WOComponent filled with data from the database as a string, which could be parsed (Hyperlinks adjusted ect.) and sent as the content of a htmlEmail via smtp-mailer.

I have been known to do this to get the output of a component for mail production...


WOContext dummyCtx = new WOContext(new WORequest("GET","/","HTTP/ 1.1",null,null,null));
MyComponent component = (MyComponent) app.pageWithName ("MyComponent",dummyCtx);
NSData componentData = component.generateResponse().content();


...then I use standard "javamail" (download from Sun site) to generate a mime message. Finally, I transport the resultant mime message over java mail. When I need to bundle images into the email rather than use external links, I use a component in my framework (download from my site) called "LEWOCIDImage" which will create the correct links in the HTML and will also produce mime parts to pop into the mime message as part of the WOResponse's 'userInfo' dictionary. See the section called "CID-Referenced Images for Email Creation with Images" in the PDF documentation.

You may also be interested in having a look at my "LEWOJavaMailHelper" in the same framework which can do some of the laborious stuff for you in this process.

This may or may not be what you are after.

cheers.

___
Andrew Lindesay
www.lindesay.co.nz



_______________________________________________
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


  • Prev by Date: get html-response inside of component and send it as html-newsletter
  • Next by Date: Re: TCPMonitor shows initial wsdl lookup but not invoke calls
  • Previous by thread: get html-response inside of component and send it as html-newsletter
  • Next by thread: Re: TCPMonitor shows initial wsdl lookup but not invoke calls
  • Index(es):
    • Date
    • Thread