4176 customizing reminder message to partner #5093
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #4176
Description
This PR adds functionality to include a customized message in the reminder email sent to partners. A rich text input field is added to the Organization edit form. It also allows interpolation for
partner_name
as a variable in the customized message similar todefault_email_text
field.The following components are added/updated:
reminder_email_text
rich text field is added to theOrganization
model.Organization
files.reminder_email_text
is displayed in both html and text versions of thenotify_deadline
email.Looking for feedback:
I allowed interpolation only for
partner_name
variable in the customized message as none of the other values made sense to include. Is there any other value that need to be allowed here, likedeadline_day
?The plain text version of the email looks like below. It contains some HTML comments.
Screenshot
I've followed the
DistributionMailer.partner_mailer
implementation and noticed that even theDistributionMailer
has the same behaviour for the plain text version of the email. I wonder if this only happens in development environment for debugging purposes... 🤔?Type of change
How Has This Been Tested?
Also tested manually. Here are the steps:
rails console
using the following set of commands:bundle exec rails console
partner = Partner.find_by_name("<Enter name of any Partner connected to your Org>")
ReminderDeadlineMailer.notify_deadline(partner).deliver_later
tmp/letter_opener
folder in the project locally.Screenshots
Example screenshot of the email:
The first sentence in the following screenshot is the custom reminder message.
Input field in Organization profile edit page:
Reminder email text in Organization profile details page: