Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i think there a solution:</p> <p>1- you have to add 2 column in the user table in your sql db if you have a user table and in the first column add the date of the last email sent to the user and the second column has the period for sending the email for that user for ex: LastEmailSentDate datetime SendEmailPeriod int</p> <p>2- in your application code write a function that compare the last date of the last sent email with the period of the sending the email.</p> <p>// here the funciton code</p> <pre><code>public void CompareLastSentDate() { // lets assume that you bring the data for the db using Sqdatareader reader //get the field from the LastEmailSentDate field in the database as i mention before DateTime LastEmailSentDate = Convert.ToDate(reader["DatePeriod"]) // get the field from the SendEmailPeriod of the user field from database int sendEmailPeriod = Convert.Toint32(reader["SendEmailPeriod"]) // now you have the date before the period of day ex: before 3 days depend on user DateTime DatePeriod = new DateTime(DateTime.Now.Year, DateTime.Now.Month, (DateTime.Now.Day - sendEmailPeriod )); // if the last email send is before period of day that mean u have to send an email again if(LastEmailSentDate.Day &lt;= DatePeriod.Day) { // sent the email to the user } } </code></pre> <p>note: now u can loop among the users and sent the email</p> <p>you can call this function once in a day by calling it from ur app home page Page_Load event and after the first call of the day add an application["LastFunctionCallDate"] = DateTime.Now flag so in the next you can check this flag if its == today and if not call it again</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload