Rende usabili i filtri destinatari e permette di eliminare le bozze email.
CI / scan_ruby (push) Failing after 12m54s
CI / scan_js (push) Successful in 12m34s
CI / lint (push) Failing after 13m10s

Le listbox non applicavano sport e altri criteri; ora i filtri sono checkbox, c'è «mai contattati» e dal cruscotto si cancellano le bozze. La lista organizzazioni allinea le colonne al foglio campagna.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-07 07:57:50 +02:00
co-authored by Cursor
parent e492c43bf8
commit 3e73e708e4
16 changed files with 1114 additions and 90 deletions
+5 -1
View File
@@ -84,7 +84,7 @@ module Mailings
def apply_history_filters(scope)
case @filters.history_kind
when "never"
scope.where.not(id: sent_org_ids)
scope.where.not(id: sent_org_ids).where.not(id: emailed_activity_org_ids)
when "received"
scope.where(id: sent_org_ids(mailing_id: @filters.history_mailing_id))
when "not_received"
@@ -127,6 +127,10 @@ module Mailings
Opportunity.where(project_id: @project.id)
end
def emailed_activity_org_ids
Activity.where(activity_type: "email_sent", organization_id: Organization.for_project(@project).select(:id)).select(:organization_id)
end
def sent_org_ids(mailing_id: nil, since: nil)
recips = history_recipients.where(status: "sent")
recips = recips.where(mailing_id: mailing_id) if mailing_id.present?