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

chore: improve direct invite by allowing html in someone_invited_you #53

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

Conversation

froger
Copy link

@froger froger commented Mar 20, 2023

The direct invitation email is the entry for some collective. The invitation must be well framed and easly readable.
As it is now, we can't set an introduction in the email in html. This is making difficult a proper well framed invitation.

This PR is to change the direct_invite mail to accept html, using the .html_safe erb filter.

Thanks

Copy link
Member

Choose a reason for hiding this comment

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

If you monkey-patch this file, add it to the spec/lib/overrides_spec.rb. It makes upgrading the Decidim version of the module easier if all the overridden files and customizations are placed there.

Anyway, could you please explain why have you customized this file?

Copy link
Author

@froger froger Mar 28, 2023

Choose a reason for hiding this comment

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

Thanks for your comment, I will try my best to explain, but will write a test to be sure:

  • when the admin checks "register user", the email that is sent is the devise one (as it goes through the InviteUser command).
  • as we want to have html template for "invitations", this includes direct and registration as well.

Our use-case is a university which will invites all its students, and we need consistency through sent emails.
Will find some time to write tests next week.

Thanks

@@ -1,7 +1,7 @@
<p><%= t("devise.mailer.invitation_instructions.hello", email: @resource.name) %></p>

<p>
<%= t("devise.mailer.invitation_instructions.someone_invited_you", application: @resource.organization.name) %>
<%= t("devise.mailer.invitation_instructions.someone_invited_you", application: @resource.organization.name).html_safe %>
Copy link
Member

Choose a reason for hiding this comment

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

You could include a test to check it's working

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.

2 participants