English 中文(简体)
限制用户每天可发送电子邮件的数量
原标题:Limit the number of emails a user can send out per day

我期望得到一项关于限制用户电子邮件数量的建议,可以每天将自己送至从事工作的Im铁路。

该网站是一个铅生成场,每个用户都可以查阅线索清单。 然后用户可以审查主要信息。 如果他想对领头采取后续行动,他就可以将自己发来,包括否则就隐藏的联系信息。

但 我只想限制他能亲自进行电子邮件的次数。 任何建议?

问题回答

显而易见的做法是,把发送用户的每封电子邮件的记录保存在一份简单的表格中,该表格不只需要用户识别和时间记录。 然后,每当他们想派一个人时,就把他们寄出的所有寄送记录从过去24小时内(或自今天上午开业以来,或当你处于边界时)拿到,看他们是否允许再派一个。

我认为,它确实需要比这更加复杂。 当然,如果在桌旁有条目24小时,你可以不时清理。 按照这些思路,另一种解决办法是只储存所寄送的电子邮件,并每天午夜重新启用所有电子邮件。 这要求绕过方向进行重新设计,或许贵数据库服务器可以做此类事情(或称职工作),但似乎与我所喜欢的守则其他部分相脱节。





相关问题
Remove ActiveRecord in Rails 3

Now that Rails 3 beta is out, I thought I d have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...

When will you upgrade your app to Rails 3? [closed]

Now that the Rails 3 beta is here, let s take a little straw poll. Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you re not planning on upgrading ...

Bundler isn t loading gems

I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I ...

bypass attr_accessible/protected in rails

I have a model that, when it instantiates an object, also creates another object with the same user id. class Foo > ActiveRecord::Base after_create: create_bar private def create_bar Bar....

concat two fields activerecord

I m so used to oracle where you can simply concat(field1, , field2) but if I m using activerecord to find the field1 and field2, and I need a space in between, how do I accomplish this? Cheers ...

热门标签