Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trayng to create a routine to send e-mail with HTML content (it may not be the best way, but it's a test).
I am storing part of the HTML code in a database in text format. In this part of the code I have a talend context variable to facilitate the reuse in multiple e-mails.
When I try to use that part of the code to send the e-mail, talend doesn't recognize the variable's content and it appears as "text" in the e-mail.
Is there a way that when I bring the code from the database, talend recognizes the variable and its content.
Atached more informations and images.tjava
tjava:
tsendmail:
Part of “context.cabecalho” contente
e-mail result
Olá @Bruno Rocha
Unfortunately, setting up a context variable using this approach won't work because you're trying to set part of Job's code at runtime.
What you can do, however, is to use "context.routinedescription" on your input HTML as a placeholder.
Considering the HTML code provided in you example, you could use String replaceAll method to replace that placeholder with the actual value stored in the context variable with the same name.
For example, you can put this code on your tMap_2 output:
row3.meuCodigoHtml.replaceAll("context\\.descricaoRotina", context.descricaoRotina) // please notice that here you're replacing a String "context.descricaoRotina" with the value stored in context.descricaoRotina variable
Espero que isso te ajude.
Good ideia, i will try this.
thanks @Anselmo Peixoto .