diff --git a/plugins/send_email/doc/send_email.textile b/plugins/send_email/doc/send_email.textile index 2b842ac..65f7f83 100644 --- a/plugins/send_email/doc/send_email.textile +++ b/plugins/send_email/doc/send_email.textile @@ -14,7 +14,7 @@ h3. Form action You should use {sendemail} macro as form action, it will be expanded as: -* */profile/<identifier>/plugins/send_email/deliver* in profile context +* */profile/<identifier>/plugin/send_email/deliver* in profile context * */plugin/send_email/deliver* in environment context h3. 'Subject' field @@ -39,6 +39,17 @@ h3. extra fields Each other params in HTML form will compose message body in a format "key: value" +h3. Example + +
+
+ To: + Subject: + Message: + +
+
+ h2. Options h3. Using ajax @@ -49,10 +60,10 @@ Example:
 
- - - - + To: + Subject: + Message: +
diff --git a/plugins/send_email/lib/send_email_plugin.rb b/plugins/send_email/lib/send_email_plugin.rb index 639f2fe..6c4310b 100644 --- a/plugins/send_email/lib/send_email_plugin.rb +++ b/plugins/send_email/lib/send_email_plugin.rb @@ -14,7 +14,7 @@ class SendEmailPlugin < Noosfero::Plugin def parse_content(raw_content) if context.profile - raw_content.gsub(/\{sendemail\}/, "/profile/#{context.profile.identifier}/plugins/send_email/deliver") + raw_content.gsub(/\{sendemail\}/, "/profile/#{context.profile.identifier}/plugin/send_email/deliver") else raw_content.gsub(/\{sendemail\}/, '/plugin/send_email/deliver') end diff --git a/plugins/send_email/test/features/send_email_plugin.feature b/plugins/send_email/test/features/send_email_plugin.feature index 36b97a9..0334d58 100644 --- a/plugins/send_email/test/features/send_email_plugin.feature +++ b/plugins/send_email/test/features/send_email_plugin.feature @@ -12,7 +12,7 @@ Feature: send_email_plugin | owner | name | body | | joaosilva | sample-article | URL path to {sendemail} action | When I go to /joaosilva/sample-article - Then I should see "URL path to /profile/joaosilva/plugins/send_email/deliver action" + Then I should see "URL path to /profile/joaosilva/plugin/send_email/deliver action" Scenario: expand macro in block content Given plugin SendEmailPlugin is enabled on environment @@ -20,7 +20,7 @@ Feature: send_email_plugin | owner | type | html | | joaosilva | RawHTMLBlock | URL path to {sendemail} action | When I go to Joao Silva's homepage - Then I should see "URL path to /profile/joaosilva/plugins/send_email/deliver action" + Then I should see "URL path to /profile/joaosilva/plugin/send_email/deliver action" Scenario: as admin I can configure plugin Given I am logged in as admin diff --git a/plugins/send_email/test/unit/send_email_plugin_test.rb b/plugins/send_email/test/unit/send_email_plugin_test.rb index 60fd29d..bb58dde 100644 --- a/plugins/send_email/test/unit/send_email_plugin_test.rb +++ b/plugins/send_email/test/unit/send_email_plugin_test.rb @@ -23,7 +23,7 @@ class SendEmailPluginTest < ActiveSupport::TestCase should 'expand macro in parse_content event on profile context' do @plugin.context.stubs(:profile).returns(fast_create(Community)) - assert_match /profile\/#{@plugin.context.profile.identifier}\/plugins\/send_email\/deliver/, @plugin.parse_content("expand this macro {sendemail}") + assert_match /profile\/#{@plugin.context.profile.identifier}\/plugin\/send_email\/deliver/, @plugin.parse_content("expand this macro {sendemail}") end end -- libgit2 0.21.2