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

Auto receive report by email when OC closes #160

Open
Tracked by #379
seballot opened this issue Nov 25, 2021 · 9 comments
Open
Tracked by #379

Auto receive report by email when OC closes #160

seballot opened this issue Nov 25, 2021 · 9 comments
Labels
Feature Request Feature request / too big for Papercut

Comments

@seballot
Copy link

seballot commented Nov 25, 2021

Happy to implement it myself if the feature is agreed

What is the need / problem?

Automatically receive a report after OC closes

Which type of users does this problem affect (and how many, if known)?

- Hub Managers (MCFEs)

Potential solutions that will solve the problem ?[[brainstorming to list feature candidates]

  • multi select box : receive following reports when cycle order close -> I think the best would be to send an email with an url to download the report, so we can include a link per format (csv, excel, pdf, print...), and we don't need attachments which consume more energy
@RachL
Copy link
Contributor

RachL commented Nov 28, 2021

Hello @seballot first of all thank you for all your suggestions! Keep them comiiiing ❤️ Just to let you know the community is currently gathering in Portugal, so we are a bit slow to answer on github / slack :)

A few feedback in the meanwhile here:

Also I think having an option to auto notify producer when CO is closed would be fine

Some hubs are against this because after the OC closes, they edit orders before sending the info to the producers. That's how we ended up with a button. So one idea is to make the automatic email optional as a checkbox indeed. We are talking about it here: https://github.com/openfoodfoundation/wishlist/issues/143

Are you happy if we keep this issue to follow the conversation?

Also linked: #100

multi select box : receive following reports when cycle order close -> I think the best would be to send an email with an url to download the report, so we can include a link per format (csv, excel, pdf, print...), and we don't need attachments which consume more energy

I would suggest we open a new issue for this one, what do you think? Maybe it's something that can be done quickly if we divide 1 issue per report? To deliver them step by step?

@seballot
Copy link
Author

seballot commented Nov 28, 2021

Hi @RachL thanks for feedback !

Maybe it's something that can be done quickly if we divide 1 issue per report? To deliver them step by step?

I don't think one issue per report is needed, it's the same job to do all of them together

Should we add this report selection on the OC config, or globally at the entreprise level? I was thing globally, but in #143 it's per OC so I guess we should do the same here?

@seballot seballot changed the title Configure Emails / Notifications Auto receive report by email when OC closes Nov 28, 2021
@RachL RachL added the Feature Request Feature request / too big for Papercut label May 6, 2022
@lin-d-hop
Copy link
Contributor

Hi @seballot
Would an appropriate solution here be a webhook that triggers when an OC closes?
This would mean a tidy little integration using the reports API that you've built could do this... any many more things too.

@seballot
Copy link
Author

Hi @lin-d-hop,

We don't need webhook here, webhook are for different websites/apps to communicate

But what I think we need is

  • Ability to create "custom report". By custom I mean save the filters/options of an existing report. Example I open packing report, select this and this fields to show, untick the summary row, choose PDF rendering and filter one of mine producer. Then I could have a button "save this report" and I give it a name -> estimate 6h
  • An interface to select which report we want to send when OC closes : options will be either default reports or custom one. We should only show reports that are relevant regarding OC (i.e. they have a filter to select an OC) -> estimate 2h

Then in the email, we can either attach the report (PDF, CSV, XLSX), or put a link in the email to download the report, or display the report directly inside the email with HTML format, or all of those solutions together :) -> estimate 3h

WDYT?

@lin-d-hop
Copy link
Contributor

lin-d-hop commented May 22, 2022

While 'sending a report on OC close' is one feature people occasionally want... actually there are a lot of functions people want to do on OC close like:

  • place auto orders into other systems
  • email people with collection instructions that include something specific like a timeslot
  • send processed details of orders to producers in specific formats like sms

With report data on the API we can achieve all of this.

So while your solution might take you 9hrs, and that's great, the utility is limited and doesn't solve a huge number of problems for people.

In general the OFN app is too complex so I am always looking for ways to simplify the app. Im also bringing the knowledge that most features we use are not widely used because they often dont quite serve the need. So I am therefore in favour of finding ways of creating max value with min features and maximum flexibility. I think a webhook on OC close does this. Of course if you wanted to develop your feature I wouldn't stop you. The 'custom report' feature in particular would be very welcomed. Though I might ask we make an epic that also includes a webhook so we can deliver even more value.

WDYT?

@seballot
Copy link
Author

Hi !

Oh, so you want a webhook at OC closes so users can catch this webhook within their own system and implement the functionalities you described? and, maybe, if one of the thing people want to do when OC closes is popular enough, implement the functionality inside OFN. But otherwise let users do what they want, is that right?

webhook is very easy to implement, it's 2hour of work

@lin-d-hop
Copy link
Contributor

lin-d-hop commented Aug 2, 2022

@seballot I wonder if you would be interested in implementing the first OFN webhook?
Once we have one it'll be easy for junior devs to develop more. If you might be interested then I can write a clear spec...

We have an OFN N8N instance now so catching the webhook to send reports could be super easy and, of course, you'd be welcome to have an account there and use for your hub :)

@seballot
Copy link
Author

seballot commented Aug 5, 2022

Dear @lin-d-hop,
Sorry but I'm not available at the moment..
However it's not very complicated. If someone want to have a try, there are great example on the web, like this one : https://keygen.sh/blog/how-to-build-a-webhook-system-in-rails-using-sidekiq/

@lin-d-hop
Copy link
Contributor

OFN Webhook on OC open close is in development.
openfoodfoundation/openfoodnetwork#9616

After this this issue can move to something for N8N

@sigmundpetersen sigmundpetersen mentioned this issue Feb 21, 2024
1 task
@github-project-automation github-project-automation bot moved this to Candidates in Wishlist Board Feb 28, 2024
@RachL RachL moved this from Candidates to Feature requests in Wishlist Board Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feature request / too big for Papercut
Projects
Status: Feature requests
Development

No branches or pull requests

3 participants