In a workflow, i'm tryng to send an email to a selected Employee, with an 'Email' property on it, using this code:
TecnicoCard = cmdb.cardFrom(Tecnico);
TecnicoCardEmail = TecnicoCard.get("Email");
cmdb.newMail()
.withFrom(gmao@canalcom.com")
.withTo(TecnicoCardEmail)
.withSubject("Orden de Trabajo Asignada")
.withContent("Se te ha asignado una Orden de Trabajo para su resolución, entra en http://gmao.ccu.corp para ver los detalles")
.send();
I'm think the
TecnicoCard.get("Email") is not working or it's not a geting a String, so the line
.withTo(TecnicoCardEmail) is not recognize by the smtp server. I'm tryng with .withTo(TecnicoCardEmail.toString()) too, with no luck..
All the examples in workflow manual, uses explicit email like withTo(email@email.com") but no example using a variable for this.
¿What am I doing wrong?
Thanks in advance
Hi,
the code you wrote is correct, TecnicoCard.get("Email") is returning a string. Your problem might be that your reference "Tecnico" is not correctly set or the email is empty. Or you have other problems in the configuration of the server. I suggest you to add some logs and see if the Email set has a correct value or not.
Regards,
CMDBuild Team
Previously Juan wrote:
In a workflow, i'm tryng to send an email to a selected Employee, with an 'Email' property on it, using this code:
TecnicoCard = cmdb.cardFrom(Tecnico);
TecnicoCardEmail = TecnicoCard.get("Email");
cmdb.newMail()
.withFrom(gmao@canalcom.com")
.withTo(TecnicoCardEmail)
.withSubject("Orden de Trabajo Asignada")
.withContent("Se te ha asignado una Orden de Trabajo para su resolución, entra en http://gmao.ccu.corp para ver los detalles")
.send();
I'm think the
TecnicoCard.get("Email") is not working or it's not a geting a String, so the line
.withTo(TecnicoCardEmail) is not recognize by the smtp server. I'm tryng with .withTo(TecnicoCardEmail.toString()) too, with no luck..
All the examples in workflow manual, uses explicit email like withTo(email@email.com") but no example using a variable for this.
¿What am I doing wrong?
Thanks in advance