X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/c2e8982b068dc4f47015679ea383a424c4defef1..65790969dc54dfb6eb8d4ad2e03a01dbd382c170:/bin/list-emails diff --git a/bin/list-emails b/bin/list-emails index 569571e..935bcd0 100755 --- a/bin/list-emails +++ b/bin/list-emails @@ -8,6 +8,10 @@ Bundler.setup require 'nos_oignons/subscriptions' subscriptions = read_subscriptions -subscriptions.each_pair do |subscription_id, data| - puts data['email'] +now = Time.now +last_year = Time.new(now.year - 1, now.month, now.day).to_date +subscriptions.sort.each do |subscription_id, data| + if data['membership_fee_paid_on'] && last_year < data['membership_fee_paid_on'] + puts data['email'] + end end