How to include Selector Unit result in Mail Unit Body?

19 Feb '14, 04:01 PM
19,866 Views
No Forum Badges

Hi,

I have a problem with inserting data from Selector Unit into Body section of an e-mail.

I want to get multiple entries from Selector Unit and put it into e-mail body.

Is there any way to do it without scripting?

If not is there any good source material about it?

I'm begginer and I have searched through Manual and Wiki with no result.

Thanks in advance!

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 5

Hello

You can use a email template, then in the template you define the code.

How can I use images in Mail Units

You can also use your text to form the String Unit

Slds

 

 

 

 
x 1
Forum Hero - Level 9

Hi,

You can use the Script unit http://www.webratio.com/learn/article/Getting-started-with-the-Script-unit, it is no difficult, in a script unit you can use groovy and java lenguaje, for example,

#input Integer a, Integer b  //a and b are the input variables

#output r // r is the result

Integer res=a*b   //for example the res is equals to a * b

return ["r":res]  // return the variable with the result

You can create a loop in the scritp with groovy 

for (i in list) { ....}

or java

for (i = 0; i < 5; i++) { ... }

you can have the input arrays and you can do a loop and create a string concatenate with your data as you develop in java and as return you can have a variable with all concatenate string for example:

"<table><tr><td>name1<td></tr><tr><td>name2<td></tr><tr><td>....<td></tr></table>"

I hope to help

 
x 1
Forum Expert - Level 5

Unfortunately if you want to have a specific format must use a script unit and with a lopp into the script form the structure of email

 
x 0
No Forum Badges

 

  • Hello

    You can use a email template, then in the template you define the code.

    http://www.webratio.com/learn/article/How-can-I-use-images-in-Mail-Units%253F;jsessionid=47E074213A11FB45A22AA24704A3F05A?link=ln344a

    You can also use your text to form the String Unit

    Slds

 But is there a way to make loop in e-mail template? Can I, for example, use JSP / JSF inside of it?

And what do you mean by forming String Unit. I have just Selector Unit and several input fields. I thought I should use them as input arrays and concatenate them into output string, but I am still not sure how to use it in the Script Unit. Is the only possibility using the Groovy script or can I use also regular Java?

 
x 0
Answer at this question and get points!

Related questions

Acceder a diferentes site views/ Acces to diferents site views Add to Bag link in ACME any webratio book ? Asking For a Book Attribute comparison in a selector unit Clarification about the NoOperation unit Codigo QR Como hacer un menu en webratio? Conditional Expression "greater than 0" on null fields Connect more query unit Content module page variable won't assign. coupled mandatory fields Create Unit with Date (Year only) Custom Attributes Condition Database Database List is not showing up in App Emulator Data is always created doubled Data Management: Updating Data - Attachments - Updating Data Sample Project Final Description: Unknown tag 'wr:LinkResource' Dudas sobre modelado(Data Flow,Forms y Operation Create) Empty record mistakenly saved en_US codify problem Export XML external link.= Filter information in a Simple List Format currency forward/backward navigation and bookmark in ajax web app "Generation Error" with Generate and Run Generation options problem get the attachment files of an email Get Unit problem Get Year from Date Help for connect public and private site views How can i create pagemenu or landmarkmenu with multiple levels. How does WebRatio represent these IFML elements? / ¿Cómo representa WebRatio estos elementos IFML? How i can reuse modules in multiple projects? How to define the sequence of execution units on a page? How to display the attributes of a related entity. How to filter imported attributes? How to pass vars to a alternative page How to process IFML Model (build with Eclipse editor) with ATL How to show a page based on a boolean? How to speed up the "last" link using PowerIndexUnit for lots of records How to store data related to an entity in relationships in a project web Insert data into database Insert master page to many hybrid modules Integrating a BPM model into an existent WebML model JSON I/O Unit e informazioni derivate KO Links in Selector Unit Landmark in hybrid module Link localization Links from Index unit with condition Link Visibility Condition Power Index Unit Mail multipla maintain the record order in a sortable list Math Unit to update attributes of an entity? [MOBILE] How I extract information from JSON client side? Modifica Entità tramite file xml Multi Entry Unit: How to forward only checked rows? multi-lingual product description Non riesco a fare funzionare Xml out unit Parametrizzazione Selector Unit Problem Example create Unit (no company in employee table) Problem in adding diagrams in IFML Editor (Eclipse) Problem with query unit! Problem with Scroller Unit query a database Question about Site Views Rename passing attributes Replace ID by its value in another table Search by Selector component does not work Select between parameters Selector unit doesn't return any value in hybrid module Sending mails is not working Sending mails with gmail is not working Setting the Default link for a Switch unit show/hide fields on button click (registration page) [solved] all links transparent, why ? Something leads to wrong condition expression evaluation. sumar atributos de una tabla filtrado por Role Condition Sum entity's values Transportation Link issue Unique Fields using relationship role conditional with null usuarios y grupos utilizzo componenti database Visibility Condition on Multiple Links From Index Unit WebRation - Create Navigation diagram