Lawtex: How do I send a PDF of the piece by email?

Asked

Viewed 57 times

2

I have a template that sends an email at the end, on the extra, and I’m having trouble getting it.

The email sending code is the:

sendMail(<advogadoDoCaso.emailAdvResponsavel>, “Atenção, já está disponível a prévia com testemunhas do processo nº ” & <dadosDoProcesso.numerodoprocesso> & “. \b\b Acesse ” & documentInfo(<docInfo.link>, “pdf”) & ” e visualize o documento.”)

The struct of docInfo is this:

-<docInfo> : struct[DocumentInfo] {
    fields {
        +[link] : String
    }
}

I have tried several ways, how to call documentInfo outside sendemail, but I am not able to make it work, because the email is sent with the blank field, as if there is no link

2 answers

2


The problem with your code is that you’re using <docInfo.link> on the call of DocumentInfo.

As it expects a struct and you passed only one text field, it returns empty, and so its result is empty.

You have two ways to solve this: 1) use documentInfo(<docInfo>, “pdf”) in the email call, and as your struct only has one field, the link, it will only print that information (if it had other fields, it would print one after the other, separated by comma)

2) before the sendMail, call for documentInfo(<docInfo>, “pdf”) and in emailing only use this code:
sendMail(<advogadoDoCaso.emailAdvResponsavel>, “Atenção, já está disponível a prévia com testemunhas do processo nº ” & <dadosDoProcesso.numerodoprocesso> & “. \b\b Acesse ” & <docInfo.link> & ” e visualize o documento.”)

  • 1

    Thanks @Luan, your answer is correct, thank you very much!

  • 1

    How great it worked for you, @atGuz!

2

Use documentInfo before the sendmail. It serves to retrieve information about a specific doc, or the current document.

  • 1

    The logic is just that, @Guilhermeumemura! <docInfo.link> on the call of DocumentInfo. Have a look at my solution: https://answall.com/a/348337/132077

Browser other questions tagged

You are not signed in. Login or sign up in order to post.