Greetings,
I'm new to Orbeon and have a question about the email processor. I have made the email processor work in my send-mail.xpl with a static address of the recipient coded in the file. I'm just wondering how can I pass an email address entered in an input filed from my view.xhml to the processor, and make the processor send an email to that address? Could someone maybe help me by giving me an example? Thanks in advance! Cheers, Jason -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Jason,
> I have made the email processor work in my send-mail.xpl with a static > address of the recipient coded in the file. I'm just wondering how can > I pass an email address entered in an input filed from my view.xhml to > the processor, and make the processor send an email to that address? > Could someone maybe help me by giving me an example? The simplest way is IMHO to use an XML instance in your view that corresponds to the input data syntax of the email processor. So you can just submit that instance to the XPL Pipeline that contains the email processor. I've attachend an example view that could act as a very (very!) frugal mail editor - only basic contraints are implemented. You need a corresponding entry in your page flow pointing to the correct XPL, for example: <page id="sendmail" path-info="/sendmail" model="services/sendmail-action.xpl" /> The example has the mail structure "hard-coded" inside the instance. Other ways are to save the mail structure as template and load it into the instance: <xforms:instance id="mail-instance" src="oxf:/instances/mail-template.xml" /> or to build it dynamically using a XPL pipeline (model) that submits the created message structure to the view. I use this for example to "pre-set" the sender depending on the current user. HTH florian -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws mailtest.xhtml (4K) Download Attachment |
In reply to this post by jasonskwok
Hi Jason,
You should use XSLT processor like in the example below <p:processor name="oxf:unsafe-xslt"> <p:input name="data" href="#instance#xpointer(PATH_TO_EMAIL_ADDRESS_FROM_INSTANCE)"> <p:input name="config" href="YOUR_XSL.xsl"/> <p:output name="data" id="message"/> </p:processor> Where #instance is input element in your send-mail.xpl i.e. <p:param name="instance" type="input"/> that must be below <p:config element. If you want to handle only specific element from your instance then put correct path for PATH_TO_EMAIL_ADDRESS_FROM_INSTANCE. Otherwise, you can handle whole instance. YOUR_XSL should produce <message> element according to the documentation. For example <message> <smtp-host>mail.example.org</smtp-host> <from> <email>[hidden email]</email> <name>Trove Smith</name> </from> <to> <email><xsl:value-of select="$instance/email_to_address"/></email> <== Here you take email address from instance <name>Jani Smith</name> </to> <subject>Reminder</subject> <body content-type="text/plain">Hello, Jani!</body> </message> Finally, you need to modify email processor input, like following. <p:processor name="oxf:email"> <p:input name="data" href="#message"/> </p:input> </p:processor> hth Nikola ----- Original Message ----- From: "Jason Kwok" <[hidden email]> To: <[hidden email]> Sent: Wednesday, September 26, 2007 1:36 PM Subject: [ops-users] question about the email processor > Greetings, > > I'm new to Orbeon and have a question about the email processor. > > I have made the email processor work in my send-mail.xpl with a static > address of the recipient coded in the file. I'm just wondering how can > I pass an email address entered in an input filed from my view.xhml to > the processor, and make the processor send an email to that address? > Could someone maybe help me by giving me an example? > > Thanks in advance! > > Cheers, > Jason > > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by jasonskwok
Thanks everyone, I have made it to work, and this finally helped:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <p:param name="instance" type="input"/> <p:processor name="oxf:email"> <p:input name="data" href="#instance"/> </p:processor> </p:config> -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |