Log newsletter emails sent

With this commit we are logging which emails have already received the
newsletter

This could be important if something goes wrong sending the newsletter,
to be able to identify which users have already received the newsletter
and be able to skip them

We’ve had to add a new action to the Activity model (email) and add
paranoia features to be able to deal gracefully with the default
`with_hidden` scope in Activities[1]

[1]
https://github.com/AyuntamientoMadrid/consul/blob/master/app/models/acti
vity.rb#L2
This commit is contained in:
rgarcia
2018-05-17 16:53:47 +02:00
committed by decabeza
parent 8960928a76
commit 9264763ec5
6 changed files with 34 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
class AddHiddenAtToNewsletters < ActiveRecord::Migration
def change
add_column :newsletters, :hidden_at, :datetime
end
end

View File

@@ -682,6 +682,7 @@ ActiveRecord::Schema.define(version: 20180711224810) do
t.date "sent_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "hidden_at"
end
create_table "notifications", force: :cascade do |t|