openfoodfoundation / openfoodnetwork

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

Add customer code to notify producer emails when enabled #13007

Open tschumilas opened 5 days ago

tschumilas commented 5 days ago

⚠️ Please use clockify code #12476 Flower Farms

Context

Flower hubs are primarily wholesale hubs to businesses (versus consumers). And, suppliers to these hubs pack the orders and label with the customer name before delivering to the hub. Most suppliers use the automated email notification to pack orders since its an email and they can forward it easily to their team/helpers, and since they seldom have wifi access (for an OFN report) in their packing sheds.

At present, the customer name is added to the automated 'notify producer' emails when this option is enabled by the hub. However, the business name (aka 'customer code' in the customer list) is not on these emails.

Description

- As a: producer - On page: "notify producer" email. email title is Order cycle report for [name of the producer) - I want to be able to do:

if the hub has enabled me to see customer names, I should receive an email that also shows the customer code as last column

-Open-Food-Network-Canada-Order-cycle-report-for-Garden-Party-gardenpartyflowerfarm-gmail-com-Gmail-11-26-2024_01_32_PM

Acceptance Criteria & Tests

  1. Login with a hub that has customer names enabled at admin/enterprises/speedy-uk-farm/edit#/shop_preferences_panel
  2. Click the "notify producer" button of the order cycle
  3. Check the customer code appears in a column after last name
  4. If nos customer code is showing up, the column should not appear
  5. If the hub has customer names disabled, no name and no code should appear in the email
RachL commented 3 days ago

@chahmedejaz this issue is ready if you have room 👍

chahmedejaz commented 3 days ago

@chahmedejaz this issue is ready if you have room 👍

Sure, Rachel, on it 👍🏻

tschumilas commented 3 days ago

Its just criminal that you were on this so fast @chahmedejaz !!@!@! Good to remember that sometimes the little things matter the most to our users.

RachL commented 3 days ago

@tschumilas FYI I'm usually getting the smallest issues ready first so if you think you have other don't hesitate to list them before our call on monday :)

chahmedejaz commented 1 day ago

Its just criminal that you were on this so fast @chahmedejaz !!@!@! Good to remember that sometimes the little things matter the most to our users.

😄😄

chahmedejaz commented 1 day ago

Hi @RachL - This feature has been implemented, however, we have an existing bug due to which customer details are not displayed in the text report in this notification mail.

The above bug is being fixed here and feedback is needed on this comment so that we could get that bug fixed in master and we could test this feature in the text report of email as well. Thanks

chahmedejaz commented 1 day ago

@RachL, @tschumilas - Here's the current implementation:

https://github.com/user-attachments/assets/0f6dff3a-18d7-41a1-9e51-8241d63bc427

Please let me know what you think about it.

tschumilas commented 20 hours ago

Looks good to me!

RachL commented 5 hours ago

Same :) Thanks @chahmedejaz