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

improve email: add link to the resource (admin) #31

Open
wants to merge 12 commits into
base: release/0.26-stable
Choose a base branch
from

Conversation

antopalidi
Copy link
Member

@antopalidi antopalidi commented Sep 16, 2022

screen

Copy link

@microstudi microstudi left a comment

Choose a reason for hiding this comment

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

Hi @antopalidi
this is ok, but I'd like to improve it a little.

I think this is a good oportunity to improve the ResourceLocatorPresenter so it returns also a admin_url.
This should be as easy as adding a new method to it:

    def admin_url(options = {})
      admin_member_route("url", options.merge(host: root_resource.organization.host))
    end

    def admin_member_route(route_type, options)
      options.merge!(options_for_polymorphic)

      admin_route_proxy.send("#{member_route_name}_#{route_type}", target, options)
    end

In addition, check the resource_locator_presenter_spec.rb to add a test for this method.

See the comments for additional info.

Thanks!

decidim-core/app/mailers/decidim/reported_mailer.rb Outdated Show resolved Hide resolved
@microstudi microstudi linked an issue Sep 19, 2022 that may be closed by this pull request
1 task
Copy link

@microstudi microstudi left a comment

Choose a reason for hiding this comment

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

Great!
The only thing missing is to test for a reported resource that has no admin link. Check the notes

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

Successfully merging this pull request may close these issues.

Improve email received on moderated content
2 participants