openfoodnetwork icon indicating copy to clipboard operation
openfoodnetwork copied to clipboard

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

Open audez opened this issue 2 years ago • 3 comments

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

audez avatar Jul 26 '22 16:07 audez

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

This solution is a papercut

RachL avatar Aug 03 '22 09:08 RachL

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

audez avatar Aug 04 '22 07:08 audez

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.

tschumilas avatar Aug 04 '22 17:08 tschumilas

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

audez avatar Aug 20 '22 15:08 audez

@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:

binarygit avatar Sep 18 '22 04:09 binarygit

@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

jibees avatar Sep 19 '22 06:09 jibees

That clears everything up. Thanks! :smile:

binarygit avatar Sep 19 '22 08:09 binarygit

#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

  • have an option to disable the email notification OR
  • not set shipment state to 'ready' automatically as soon as the order is complete and paid, but instead do this manually OR
  • add an additional shipment state (e.g. 'packed') which is activated manually and is located between 'ready' and 'shipped' OR
  • you may have better ideas...

drummer83 avatar Oct 08 '22 12:10 drummer83

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:

  • Have a different wording for shipment status "Shipped" if it's a pickup order --> for ex "Delivered" instead of "Shipped"
  • Have an option to disable the email notification for pickup orders when shipment state is "Delivered"
  • Adding order number and date in the mails sent to clients after pickup or delivery
  • Uncorrelate the shipment and payment status to allow users to manually set the shipment state
  • And this one is a request from user: Add a shipment status between "pending" and "ready", because they would like to differentiate between an order that they've considered and need to prepare from an order they didn't check yet. So there would be 4 status: "pending", "to prepare", "ready", "shipped"/"delivered"

What do y'all think?

audez avatar Nov 13 '22 19:11 audez

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 :)

audez avatar Nov 21 '22 12:11 audez