doumowu7371 2012-07-10 23:46
浏览 6

mysql / php电子邮件问题

I created an emailer that checks when was the last time a user logged in, if the user didnt log in for 10 days it sends him/her an email. Now I want the system to check if that same user does it twice, and email them a different email. table 1 users:

id - name - loggedindate
0    john      7/11/2012
1    mark      7/6/2012
2    johnny    7/6/2012
3    bruce     7/2/2012

table 2 mailer fields are as follow:

id - days -emailtosend - numberoftimeseventhappens
0     4      hello                  1
1     4      blabla                 2
2     6      example                1
3     3      to                     1
4     4      demonstrate            1

so here for example mark and johnny didnt log in for 4days. the first time that event happens it sends them the email "hello" the second time the event happens the emailer needs to send them "blabla" so lets say mark doesn't log in for 4days,first email will go then he logs in on day 5, then after another 4days he doesnt log in, I want to send him the second email that would be ID=2 on table 2 the file runs on a cron and checks every 2 hours any ideas on how to do it ? I just need the way to do it not the actual code I can write it myself, I ve been pulling my hair over this one.

  • 写回答

3条回答 默认 最新

  • duansai1314 2012-07-10 23:48
    关注

    Add a new field to the user table that keeps track of the last type of email that was sent to them. Next time you have to send an email, you send "last email + 1"

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大