There are a few relatively small adjustments that need to be made to the way emails are sent out.
In this system we have several statuses that each event is assigned to
verified - the event is up to date and in published
needs_review - the event has not been checked in 2 months, and someone needs to verify it is still accurate
needs_urgent_review - the event will expire in 1 week if not checked, and the city manager will be notified immediately
expired - the event has expired and will no longer be shown on the map
archived - the event has been expired for 2 weeks, and we will no longer notify anyone that is gone.
Any time the status of an event changes, we send an email to the owner of that event, to let them know (except for "verified"). This is a core feature of the Atlas, because the idea is to automate as much as possible the process of keeping the database up to date. In general we have the problem that in some countries, the yogis running the program as bad at responding to these emails. The changes in this ticket are focused on improving that situation.
Here are the tasks that need to be done, in order from easiest to most complex:
[ ] Event status emails need to show how many days until the event will expire.
[ ] The "Expired" event status emails need to signal more urgency. An exclamation mark, possibly change the blue colour to red.
[ ] For all emails, the reply_to field should be set to their closest manager in the hierarchy.
[ ] Event status emails need to be updated so that there are 3 action buttons instead of 2. We need to add a third button which says "No, the program is no longer running" (look at the file views/mail/events/status.html.slim). This will need to link to a controller action that simply unpublished the event.
[x] If the event manager and the city manager are the same person, we should avoid sending needs_urgent_review emails twice.
[ ] We should send one more expiration reminder, the day before an event will expire. We could call this needs_immediate_review. If you search for all instances of needs_urgent_review you can use that as a guidepost for what needs to be updated.
Here are more details for each task
Event status emails should show days until expiration
You can use this code to display the number of days or weeks until expiration, as text: time_from_now_in_words @event.should_expire_at.
Look at the file views/mail/events/status.html.slim to modify the email html.
This change should only apply for to needs_review and needs_urgent_review statuses.
More urgency for "expired" events
This is simple HTML and CSS editing
Look at the file views/mail/events/status.html.slim to modify the email html.
Look at assets/stylesheets/mail to modify the CSS. Try to keep CSS to a minimum because it has to be auto-bundled into the email.
Add reply-to field for all emails
The hierarchy of data in the Atlas is Event < City < Region < Country < World. Every level of this hierarchy could have a manager assigned to it, or might not. You will need to use the parent and managers attributes to find the nearest level of the hierarchy which has a manager, and set the reply_to field using their address
You should also use email_verified? to check if a manager's email address is verified before settling on them.
Event status emails need a "cancel event" buttonDetails to come
We need to send an additional email notificationDetails to come
There are a few relatively small adjustments that need to be made to the way emails are sent out.
In this system we have several statuses that each event is assigned to
Any time the status of an event changes, we send an email to the owner of that event, to let them know (except for "verified"). This is a core feature of the Atlas, because the idea is to automate as much as possible the process of keeping the database up to date. In general we have the problem that in some countries, the yogis running the program as bad at responding to these emails. The changes in this ticket are focused on improving that situation.
Here are the tasks that need to be done, in order from easiest to most complex:
Here are more details for each task
Event status emails should show days until expiration
time_from_now_in_words @event.should_expire_at
.views/mail/events/status.html.slim
to modify the email html.More urgency for "expired" events
views/mail/events/status.html.slim
to modify the email html.assets/stylesheets/mail
to modify the CSS. Try to keep CSS to a minimum because it has to be auto-bundled into the email.Add reply-to field for all emails
Event < City < Region < Country < World
. Every level of this hierarchy could have a manager assigned to it, or might not. You will need to use theparent
andmanagers
attributes to find the nearest level of the hierarchy which has a manager, and set the reply_to field using their addressemail_verified?
to check if a manager's email address is verified before settling on them.Event status emails need a "cancel event" button Details to come
We need to send an additional email notification Details to come