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

Backport 'Fix email subject when participatory space title is present' to v0.26 #9573

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
it_behaves_like "a simple event"

describe "email_subject" do
let(:assembly) { create(:assembly, organization: organization, title: { en: "It's a test" }) }
let(:blogs_component) { create :component, :published, name: { en: "Blogs" }, participatory_space: assembly, manifest_name: :blogs }

before do
resource.component = blogs_component
resource.save!
end

it "is generated correctly" do
expect(subject.email_subject).to eq("New post published in #{participatory_space_title}")
end
Expand Down
1 change: 1 addition & 0 deletions decidim-core/lib/decidim/events/simple_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def email_subject
def email_subject_i18n_options
sanitized_values = { resource_title: decidim_sanitize(resource_title) }
sanitized_values[:mentioned_proposal_title] = decidim_sanitize(mentioned_proposal_title) if i18n_options.has_key?(:mentioned_proposal_title)
sanitized_values[:participatory_space_title] = decidim_sanitize(participatory_space_title) if i18n_options.has_key?(:participatory_space_title)
i18n_options.merge(sanitized_values)
end

Expand Down