Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
11 replies
Subscribers
9 subscribers
Views
5087 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
SendEmail Is there a way to insert a Text or HTML Email Template at
aneeshv
over 12 years ago
SendEmail
Is there a way to insert a Text or HTML Email Template at runtime in the SendEmail Smart Service?
For e.g. I want to select an Email Template based on Language at runtime.
If Language = Spanish , Select Spanish Template
If Language = French, Select French Template
If Language = English, Select English Template
Etc.
I don't see this option currently?
How can we achieve this with a Text or HTML Template?
...
OriginalPostID-63550
OriginalPostID-63550
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 12 years ago
The template field in the "Send E-mail" smart service is not an expression-able, you cannot use conditions to assign the template. Instead you could use a gateway (e.g. XOR) to direct the flow to a different send e-mail configured with the corresponding template. Assuming you have 3 languages, your model would need three different send e-mail nodes pointing to different templates; the decision of which one should be trigger would be delegated to the gateway not to the send e-mail activity.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 12 years ago
There is a plugin funtion textfromtemplate. The file used as template is variable.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aneeshv
over 12 years ago
I will try textFromtemplate.
But eduardo, your solution is cumbersome and not flexible and cannot be extended or is not scalable.
What if, our organization has more than 15 to 20 languages? And what if, we decide to add new languages every month?
In that case, I have to go in everytime, add a new Send Email Activity, update my gateway and retest and republish my process model. This is a lot of work. Instead, what if I have a set of templates in the Documents Section and pass them at runtime based on a certain value in a Multiple Constant? This is more dynamic and is scalable.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aneeshv
over 12 years ago
Hi Shelzle, Can we pass variables to that template (textFromTemplate) at runtime?
Similar to the Email template?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 12 years ago
Of course. You create an expression with content like this
Parameters: template_document, data_cdt
= textfromtemplate ( ri!template_document , { "name" , "prize" , "description"} , {ri!data.name, if(isnull(ri!data.prize), "---", fixed ( ri!data.prize, 2 )), substitute(ri!data.description, char(10)})
Your template (a plain text file) looks like:
<p>###name###</p>
<p>###prize###</p>
<p>###description###</p>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 12 years ago
Aneeshv I'm interesting a out this topic, please give us the feedback when you find a good solution :)
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aneeshv
over 12 years ago
Ok.. Once I test it, will let you know... Shelzle's solution seems to be better.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 12 years ago
OK, thanks...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Giobis
over 12 years ago
@aneeshv Do you have any news a out this topic? Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aneeshv
over 12 years ago
No, we haven't tried the Smart Service. Please go ahead and try it yourself.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>