openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

[Admin][Orders page] Add a dedicated email for pickup orders when switching shipment state to "Shipped" #9561

Closed audez closed 2 years ago

audez commented 2 years ago

Context

Some hub managers that use the "Pick up" shipping method want to be able to differentiate an order that is ready from an order that has been distributed. For this, they use the "Ship" button (road icon) in the Orders page, which switches the Shipment state from "Ready" to "Shipped". But clicking on this button automatically send the customer an email, and this email is designed only for delivery orders. It indicates that the order has been shipped. It creates confusion because in the case of pickup orders, customers have already received their order. Furthermore, the email doesn't include information about the order completion date or order number, and can be received way after the pickup date. Hub managers and customers are thus worried to receive an order confirmation without having placed an order.

2022-07-26 18 29 54

Description

- As a: enterprise user or super admin - On page: /admin/orders - I want to be able to do: When shipping an order, if the shipping method category of the order is "pick up" then I should receive a different email content than when the shipping method category is "delivery".

Screen Shot 2022-07-26 at 13 38 35

FYI this is the shipped email version:

image

New title should become (release farm is the name of the hub):

image

Email body default (but can be changed by instance managers in translation):

Dear customer,

Your order from release farm has been picked-up.

Order summary Melonn 1000 sachets Thank you for your business

Acceptance Criteria & Tests

  1. Log in as enterprise
  2. Ship an order with pick up shipping category, check the email content is correct
  3. Ship an order with delivery category, check the email content is correct
  4. Repeat on different payment method (cash & credti card)
  5. Repeat with super admin
RachL commented 2 years ago

Other solution : send a different email confirming the order has been picked up.

This solution is a papercut

audez commented 2 years ago

One more case today of a customer not understanding why she received an email! @RachL I'm not sure for the fact of sending a different email because the managers often click on the button long after the delivery (15 days after for today's case), so it might still be weird for the customer

Edit: +1 case of a customer not understanding why she received an email on 10/08

tschumilas commented 2 years ago

I'm glad to see this issue and glad its a papercut!! We have the same problem. I've already re-worded the content of the 'shipped' email in transifex so that it says basically - "your order has either been shipped or picked up".... This has helped. But I agree that many enterprises don't finalize/acknowledge payment and shipping/pickup status of orders for weeks. So if its a papercut, it would be our preference to not send any automated message for picked up orders. It seems to me, if an enterprise WANTS these emails sent, then they can just make sure their shipping method is a delivery method. And the instance can word the text of the message so that it accommodates both shipped and picked up orders. So - seems like all the options are covered then.

audez commented 2 years ago

@RachL I've reworded the content of the email in transifex too, so we don't have more requests while the problem is resolved :)

binarygit commented 2 years ago

@mkllnk @jibees

We're using those radio inputs to just toggle the require_ship_address to true or false.

  .row
    .alpha.four.columns
      -# The 'Category' label here is just a logical descriptor for the data we are trying to collect for 'requires_ship_address'
      -# and does not relate to shipping categories in any way.
      = f.label :require_ship_address, t(:category)
    .three.columns
      = f.radio_button :require_ship_address, true
       
      = f.label :delivery, t(:delivery)
    .omega.six.columns
      = f.radio_button :require_ship_address, false
       
      = f.label :pick_up, t(:pick_up)

And I checked my ShippingCategory model but there's only this in there. This is from the default OFN seed data.

shippingMethod

No pickup or delivery. And it seems to be a has_many relationship with ShippingMethod. So, shipping_method.shipping_categories

I think that there's no real pickup or delivery shipping categories. Like

shipping_method.category 
=> 'pickup'

If something like this is there, I haven't found it.

So, it looks like we'll first need to create a new attribute called category_id in the ShippingMethod models and then populate it with either pickup or delivery (their corresponding id's from this new category model) But there are already models ShippingCategory and ShippingMethodCategory so I thought I would check if I had overlooked something. If I have, please let me know and then maybe we won't have to create a new model for this. If I haven't, what do I name this new model?

P.S. Sorry for the issue getting closed. It was an accident :sweat_smile:

jibees commented 2 years ago

@binarygit If I understood correctly, I think those two lines will helps you a lot:

https://github.com/openfoodfoundation/openfoodnetwork/blob/887f886110a90b294ee5e0acb98cb65b1c2f4bd8/app/models/spree/shipping_method.rb#L98-L99

binarygit commented 2 years ago

That clears everything up. Thanks! :smile:

drummer83 commented 2 years ago

9682 was created to solve this issue. Looking at it in detail I understand that #9682 is great to have, but it's not really solving the original need. If this is true, @audez or @tschumilas, I would propose to open a wishlist item to either

audez commented 1 year ago

Yes i agree @drummer83 i don't think it's really solving the need neither, and clients are still confused even with 9682 and the new mail.. 😿

I like both options 1 & 2 - and the fact to manually choose the shipment state is a request we've had from users. Option 3 i'm not sure because for pickups generally when the order is "ready" that means it's "packed", and i'm afraid they still would go to the last step "shipped" when it's delivered, so it will send the mail anyway.

So actually I'd like to create several wishlists:

What do y'all think?

audez commented 1 year ago

Have a different wording for shipment status "Shipped" if it's a pickup order --> for ex "Delivered" instead of "Shipped"

this is already the topic of #287, i added a comment :)