Quantcast
Viewing all articles
Browse latest Browse all 21760

Using recordcount to send an email when dynamic number is hit

I have the following script that will fire off an email when a set number is achieved, ie: "minrequire" is set to 6.  When six students have subscribed, an email is sent to the moderator. The problem is the email is being sent multiple times as more students subscribe, instead of only once at 6. Below is the script I am using. Why is this sending more than one emails?

 

<cfquery name="getNumber" datasource="#application.dsn#">

    select CourseTitle, rid

    from signups

    where courseTitle = '#eventname#' and rid = '#rid#'

    </cfquery>   

 

    <cfif getNumber.recordcount EQ #getCount.minRequire#>


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>