Guest User

Untitled

a guest
Oct 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def self.eligible_abandoned_email_orders
  2. where('state != ?
  3. AND (payment_state IS NULL OR payment_state != ?)
  4. AND email is NOT NULL
  5. AND abandoned_email_sent_at IS NULL
  6. AND (spree_orders.created_at BETWEEN ? AND ? )',
  7. 'complete',
  8. 'paid',
  9. (Time.zone.now - Spree::AbandonedCartEmailConfig::Config.email_timeframe_from),
  10. (Time.zone.now - Spree::AbandonedCartEmailConfig::Config.email_timeframe_to)).joins(:line_items).distinct
  11. end
Add Comment
Please, Sign In to add comment