Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Send Notification of Facility Report Response #1250

Merged
merged 3 commits into from Mar 2, 2021

Conversation

TaiWilkin
Copy link
Contributor

Overview

The user who reports a facility as closed or reopened will receive a
notification email when an OAR administrator confirms or rejects the
report.

Connects #1247

Demo

Rejected
rejected

Confirmed
confirmed

No Reason Provided
Screen Shot 2021-02-18 at 11 20 59 AM

Notes

We are planning to reopen this and adjust the email content once the finalized notification text is provided.

Testing Instructions

  • Run ./scripts/server
  • Go to activity reports and confirm one. Enter text explaining the reason for the confirmation.
    • An email should print to the console with the reason included.
  • Reject a report, entering a reason for the rejection.
    • An email should print to the console with the reason included.
  • Confirm or reject a report and enter no reason.
    • An email should print to the console.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

@jwalgran
Copy link
Contributor

Looking at this now.

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

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

Looks good. I was able to successfully see mail in the console.

We should hold off on merging this until we get final text from @katieashaw.

@jwalgran
Copy link
Contributor

@katieashaw The application is ready to send email to contributors when a facility closure/reopening is approved or rejected by the moderation team. Please add the text you want to appear in the emails in a comment on issue #1247 or comment on this PR. Thanks.

@jwalgran jwalgran assigned TaiWilkin and unassigned jwalgran Feb 22, 2021
@katieashaw
Copy link

Facility closure approved text:

Hi there,

Thanks for reporting XXX facility as closed. The facility profile in the Open Apparel Registry has now been updated and the facility is marked as closed.

OAR Team review notes:

Should you receive reports that the facility is re-opened in the future, you can share this update with the OAR Team.

Best wishes,

The OAR Team

Facility closure rejected text

Hi there,

Thanks for reporting XXX facility as closed. We have rejected this report and the facility's profile in the OAR has not been changed.

OAR Team review notes:

If you have additional evidence that can be used to verify the facility closure, this can be shared with: info@openapparel.org

Best wishes,

The OAR Team

Facility reopening approved text

Hi there,

Thanks for reporting that XXX facility has re-opened. The facility profile in the Open Apparel Registry has now been updated and the facility is no longer marked as closed.

OAR Team review notes:

Best wishes,

The OAR Team

Facility reopening rejected text

Hi there,

Thanks for reporting that XXX facility has re-opened. We have rejected this report and the facility's profile in the OAR has not been changed.

OAR Team review notes:

If you have additional evidence to verify the facility re-opening, this can be shared with: info@openapparel.org

Best wishes,

The OAR Team

@TaiWilkin
Copy link
Contributor Author

@jwalgran Could you take another look and confirm that the updated text looks good to you? I ended up making more code changes than I initially expected in the process of updating.

@jwalgran
Copy link
Contributor

Looking at this now.

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

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

I tested these and they look good. I made a note about how we can potentially clean up the output of the plain text template.

Thanks for reporting {{ facility_name }} facility as {{ closure_state|lower }}.
{% if is_closure and is_rejected %}
We have rejected this report and the facility's profile in the OAR has not been changed.
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Newlines in the templates are preserved in the output, even if the only content on the line is a template tag

django_1    | --===============8035258767979269043==
django_1    | Content-Type: text/plain; charset="utf-8"
django_1    | MIME-Version: 1.0
django_1    | Content-Transfer-Encoding: 7bit
django_1    |
django_1    |
django_1    |     Hi there,
django_1    |
django_1    |     Thanks for reporting 4teams - Advertising & Merchandising, Lda. facility as closed.
django_1    |
django_1    |     We have rejected this report and the facility's profile in the OAR has not been changed.
django_1    |
django_1    |
django_1    |
django_1    |
django_1    |
django_1    |     OAR Team review notes: NOO
django_1    |
django_1    |
django_1    |     If you have additional evidence that can be used to verify the facility has closed, this can be shared with: info@openapparel.org
django_1    |
django_1    |
django_1    |
django_1    |     Best wishes,
django_1    |
django_1    |
django_1    | Open Apparel Registry
django_1    |
django_1    |
django_1    |
django_1    |
django_1    | --===============8035258767979269043==

It makes the conditionals in the templates a little harder to read but we should consider removing some newlines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated:
Screen Shot 2021-02-25 at 10 23 27 AM

@jwalgran jwalgran removed their assignment Feb 24, 2021
The user who reports a facility as closed or reopened will receive a
notification email when an OAR administrator confirms or rejects the
report.
One of the activity report proptypes was incorrect.
@TaiWilkin TaiWilkin force-pushed the tw/send-report-notification branch from 948cb66 to 0f01689 Compare March 2, 2021 16:45
@TaiWilkin TaiWilkin merged commit fae98f0 into develop Mar 2, 2021
@TaiWilkin TaiWilkin deleted the tw/send-report-notification branch March 2, 2021 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants