You can create a form with a send mail checkbox, giving users a choice of receiving mail.
<input type="checkbox" name="recvmail" value=""> receive mail |
Because Irma accepts expressions everywhere, including tags and options, automating this condition is easy: it is sufficient to check whether the checkbox value is empty or not.
If the box is checked, the EMAIL$recvmail expression is evaluated to EMAILon and EMAIL in the other case. We are looking for an opposite behavior, so that the existing EMAIL tag is transformed into a simple html comment that Irma does not understand when the checkbox is not selected.
<!--EMAIL£recvmail^[-IGNORE]--$email-- Body of a mail message. --> |
You can run, download and view the source of a demo performing actions similar to those described in this section from http://irma.vestris.com/docs/demos/demo2-form.html and http://irma.vestris.com/docs/demos/demo2-template.html .