Rende usabili i filtri destinatari e permette di eliminare le bozze email.
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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user