Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Order Notification Emails for Store Owner #10253

Merged
merged 6 commits into from
Jun 17, 2020

Conversation

imderek
Copy link
Contributor

@imderek imderek commented Jun 11, 2020

Resolves #10098.

This will give store owners the option to receive email notifications when new orders are placed.

@squash-labs
Copy link

squash-labs bot commented Jun 11, 2020

Manage this branch in Squash

Test this branch here: https://imdereknotify-store-owner-of-n-vr8kx.squash.io

@imderek imderek force-pushed the notify_store_owner_of_new_orders branch from f4ede99 to 7a15294 Compare June 11, 2020 19:15
@imderek imderek changed the title Issue #10098 | Store Owner: Order Notification Emails Store Owner: Order Notification Emails Jun 11, 2020
@imderek imderek changed the title Store Owner: Order Notification Emails Feature: Order Notification Emails for Store Owner Jun 11, 2020
Copy link
Member

@damianlegawiec damianlegawiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome @imderek 🚀 Could you fix the one migration issue and we could merge this!

@imderek
Copy link
Contributor Author

imderek commented Jun 16, 2020

@damianlegawiec One other thing. There's an older migration from 2014 that actually starts looking up and saving Spree::Store records. If my migration (which adds a new column to spree_stores) doesn't run before 20140309033438_create_store_from_preferences, the build fails because of the validation I added for that new column.

validates :new_order_notifications_email, email: { allow_blank: true }

This column obviously won't exist until my migration has run. Any suggestions for how I might address this?

@damianlegawiec
Copy link
Member

Hey @imderek

You can wrap this validation in column_exists? block, eg.

connection.column_exists?(:spree_stores, :new_order_notifications_email)
  validates :new_order_notifications_email, email: { allow_blank: true }
end

We need those migrations with proper dates, let's not jump back in time 😂

… reverted to current; validation only applies to model when col exists
Copy link
Member

@damianlegawiec damianlegawiec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @imderek - thank you! 🎉

@damianlegawiec damianlegawiec merged commit 40339db into spree:master Jun 17, 2020
@imderek imderek deleted the notify_store_owner_of_new_orders branch June 17, 2020 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store does not receive e-mail when a new order is made
2 participants