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

4176 customizing reminder message to partner #5093

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Sukhpreet-s
Copy link
Contributor

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 to default_email_text field.

The following components are added/updated:

  • reminder_email_text rich text field is added to the Organization model.
  • The form field is added to the edit and show details Organization files.
  • The reminder_email_text is displayed in both html and text versions of the notify_deadline email.

Looking for feedback:

  1. 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, like deadline_day?

  2. 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 the DistributionMailer 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

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Wrote test case to verify if the custom message is included in the email text when it is added by the org admin.

Also tested manually. Here are the steps:

  1. Sign in as org admin.
  2. Open org profile by clicking "My Organization" in the sidebar.
  3. Edit the profile by clicking "Edit" button at the bottom of the page.
  4. Add some text in "Reminder Email Content" input field and save.
  5. Since this email is sent via a job that runs daily at some set time, it is convenient to execute the Mailer function directly from the rails console using the following set of commands:
    • Execute rails console from terminal: bundle exec rails console
    • Get associated partner: partner = Partner.find_by_name("<Enter name of any Partner connected to your Org>")
    • Send email: ReminderDeadlineMailer.notify_deadline(partner).deliver_later
  6. The email should be sent and can be accessed from 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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customizing Reminder Message to Partners
1 participant