diff --git a/app/helpers/react_on_rails_helper.rb b/app/helpers/react_on_rails_helper.rb index 6cc6896db..1f63f39a0 100644 --- a/app/helpers/react_on_rails_helper.rb +++ b/app/helpers/react_on_rails_helper.rb @@ -343,8 +343,8 @@ def initialize_redux_stores # second parameter passed to both component and store generator functions. def rails_context(server_side:) @rails_context ||= begin - result = {} - unless request.nil? + # result = {} + # unless request.nil? # Using Addressable instead of standard URI to better deal with # non-ASCII characters (see https://github.com/shakacode/react_on_rails/pull/405) uri = Addressable::URI.parse(request.original_url) @@ -365,11 +365,11 @@ def rails_context(server_side:) i18nDefaultLocale: I18n.default_locale, httpAcceptLanguage: request.env["HTTP_ACCEPT_LANGUAGE"] } - end - if ReactOnRails.configuration.rendering_extension - custom_context = ReactOnRails.configuration.rendering_extension.custom_context(self) - result.merge!(custom_context) if custom_context - end + # end + # if ReactOnRails.configuration.rendering_extension + # custom_context = ReactOnRails.configuration.rendering_extension.custom_context(self) + # result.merge!(custom_context) if custom_context + # end result end diff --git a/spec/dummy/app/mailers/dummy_mailer.rb b/spec/dummy/app/mailers/dummy_mailer.rb new file mode 100644 index 000000000..b8df25a99 --- /dev/null +++ b/spec/dummy/app/mailers/dummy_mailer.rb @@ -0,0 +1,9 @@ +class DummyMailer < ActionMailer::Base + add_template_helper(ReactOnRailsHelper) + default from: 'nobody@nope.com' + # layout 'mailer' + + def hello_email + mail(to: 'otherperson@nope.com', subject: "you've got mail") + end +end \ No newline at end of file diff --git a/spec/dummy/app/views/dummy_mailer/hello_email.html.erb b/spec/dummy/app/views/dummy_mailer/hello_email.html.erb new file mode 100644 index 000000000..8c0a41de0 --- /dev/null +++ b/spec/dummy/app/views/dummy_mailer/hello_email.html.erb @@ -0,0 +1,3 @@ +Someone emailed this to you: + +<%= react_component("HelloWorld", props: {}, prerender: true) %> \ No newline at end of file diff --git a/spec/dummy/spec/requests/server_render_check_spec.rb b/spec/dummy/spec/requests/server_render_check_spec.rb index 8840de2f0..804c3d4f7 100644 --- a/spec/dummy/spec/requests/server_render_check_spec.rb +++ b/spec/dummy/spec/requests/server_render_check_spec.rb @@ -58,6 +58,13 @@ end end + describe "server render mailer" do + it 'sends email okay' do + mail = DummyMailer.hello_email + expect(mail.subject).to match 'mail' + end + end + describe "server rendering railsContext" do let(:http_accept_language) { "en-US,en;q=0.8" }