[Zope] How to e-mail only when data available?

Edwin Martin e.j.martin@chello.nl
Tue, 10 Apr 2001 00:53:10 +0200


I have an e-mail list and I want to regularly send agenda-items.

But I don't want to send anything when there are no items.

I can't find a way to do that.

See my script at the bottom of the page.

mailing_sqlselectactief selects all e-mail addresses and some
variables (soort and regio) which makes a selection from the agenda.

mailing_sqlverstuur uses soort and regio to select agenda items

I have to do <dtml-call>, otherwise the script won't work (weird!)

What can I do to send the list *only* when there is a list?

I tried putting <dtml-sendmail mailhost="MailHost">
inside the <dtml-if sequence-start>, but that's not possible.

<dtml-in mailing_sqlselectactief>
<dtml-call "REQUEST.set('soort',soort)">
<dtml-call "REQUEST.set('regio',regio)">
<dtml-in mailing_sqlverstuur>
<dtml-if sequence-start>
To: <dtml-var email>
From: x
Subject: x

</dtml-if>

----
<dtml-var showagendaitem>

</dtml-in>
</dtml-in>