This discussion is archived
2 Replies Latest reply: Feb 29, 2012 1:41 PM by ssmorris RSS

Tricky Question about Dynamic Input to change an Email Template

ssmorris Newbie
Currently Being Moderated
This might be a tricky question with a difficult answer, but any help or direction is greatly appreciated.

We are trying to create a user email process using BPEL. The idea we have is have a repository of email templates with key words within the HTML code (i.e. - [FIRST NAME]). So the message would look like the following:

h4. "Greetings [FIRST_NAME],"


The user would submit an XML request submitting the essential details for email (from, to, subj, body, etc) along with a series of XML tags and data, like the following (shorthand):

<xp:process>
<xp:email>test@mail.com;/xp:email>
<xp:fields>
<parameter>FIRST_NAME</parameter>
<value>Scott</value>
</xp:fields>
</xp:process>

Now the question, is there a way using Fusion that we can take the input based on 1 to many fields being submitted to find and replace all occurrences of [FIRST_NAME] with Scott?

The 2nd part of my question, if the above is possible, is can it handle a multiple input parameter. Example:

<xp:process>
<xp:email>test@mail.com;/xp:email>
<xp:fields>
<parameter>FIRST_NAME</parameter>
<value>Scott</value>
</xp:fields>
<xp:fields>
<parameter>LAST_NAME</parameter>
<value>Smith</value>
</xp:fields>
<xp:fields>
<parameter>Age</parameter>
<value>27</value>
</xp:fields>
</xp:process>

Sorry for the length of the post, but I am not sure how to even phrase what I am looking for.

Thanks for any advice!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points