{"action":"created","issue":{"url":"https://api.github.com/repos/bigbinary/mail_interceptor/issues/10","labels_url":"https://api.github.com/repos/bigbinary/mail_interceptor/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/bigbinary/mail_interceptor/issues/10/comments","events_url":"https://api.github.com/repos/bigbinary/mail_interceptor/issues/10/events","html_url":"https://github.com/bigbinary/mail_interceptor/pull/10","id":55447378,"number":10,"title":"subject prefix issue","user":{"login":"justanshulsharma","id":4547169,"avatar_url":"https://avatars.githubusercontent.com/u/4547169?v=3","gravatar_id":"","url":"https://api.github.com/users/justanshulsharma","html_url":"https://github.com/justanshulsharma","followers_url":"https://api.github.com/users/justanshulsharma/followers","following_url":"https://api.github.com/users/justanshulsharma/following{/other_user}","gists_url":"https://api.github.com/users/justanshulsharma/gists{/gist_id}","starred_url":"https://api.github.com/users/justanshulsharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justanshulsharma/subscriptions","organizations_url":"https://api.github.com/users/justanshulsharma/orgs","repos_url":"https://api.github.com/users/justanshulsharma/repos","events_url":"https://api.github.com/users/justanshulsharma/events{/privacy}","received_events_url":"https://api.github.com/users/justanshulsharma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"justanshulsharma","id":4547169,"avatar_url":"https://avatars.githubusercontent.com/u/4547169?v=3","gravatar_id":"","url":"https://api.github.com/users/justanshulsharma","html_url":"https://github.com/justanshulsharma","followers_url":"https://api.github.com/users/justanshulsharma/followers","following_url":"https://api.github.com/users/justanshulsharma/following{/other_user}","gists_url":"https://api.github.com/users/justanshulsharma/gists{/gist_id}","starred_url":"https://api.github.com/users/justanshulsharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justanshulsharma/subscriptions","organizations_url":"https://api.github.com/users/justanshulsharma/orgs","repos_url":"https://api.github.com/users/justanshulsharma/repos","events_url":"https://api.github.com/users/justanshulsharma/events{/privacy}","received_events_url":"https://api.github.com/users/justanshulsharma/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-01-26T05:11:21Z","updated_at":"2015-01-26T10:24:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bigbinary/mail_interceptor/pulls/10","html_url":"https://github.com/bigbinary/mail_interceptor/pull/10","diff_url":"https://github.com/bigbinary/mail_interceptor/pull/10.diff","patch_url":"https://github.com/bigbinary/mail_interceptor/pull/10.patch"},"body":"``` ruby\r\n  def test_subject_prefix_in_test\r\n    interceptor = ::MailInterceptor::Interceptor.new forward_emails_to: 'test@example.com',\r\n                                                       subject_prefix: 'wheel'\r\n    @message.subject = 'Forgot password'\r\n\r\n    interceptor.delivering_email @message\r\n    assert_equal \"[wheel TEST] Forgot password\", @message.subject\r\n\r\n    @message.subject = 'Forgot password'\r\n    interceptor.delivering_email @message\r\n    assert_equal \"[wheel TEST] Forgot password\", @message.subject\r\n  end\r\n```\r\nthis scenario fails \r\n```\r\n-\"[wheel TEST] Forgot password\"\r\n+\"[[wheel TEST] TEST] Forgot password\"\r\n```\r\n\r\nwe need to move add_env_info_to_subject_prefix from https://github.com/bigbinary/mail_interceptor/blob/master/lib/mail_interceptor.rb#L18 \r\nto \r\nhttps://github.com/bigbinary/mail_interceptor/blob/master/lib/mail_interceptor.rb#L13\r\n\r\n@neerajdotname "},"comment":{"url":"https://api.github.com/repos/bigbinary/mail_interceptor/issues/comments/71440278","html_url":"https://github.com/bigbinary/mail_interceptor/pull/10#issuecomment-71440278","issue_url":"https://api.github.com/repos/bigbinary/mail_interceptor/issues/10","id":71440278,"user":{"login":"vipulnsward","id":567626,"avatar_url":"https://avatars.githubusercontent.com/u/567626?v=3","gravatar_id":"","url":"https://api.github.com/users/vipulnsward","html_url":"https://github.com/vipulnsward","followers_url":"https://api.github.com/users/vipulnsward/followers","following_url":"https://api.github.com/users/vipulnsward/following{/other_user}","gists_url":"https://api.github.com/users/vipulnsward/gists{/gist_id}","starred_url":"https://api.github.com/users/vipulnsward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vipulnsward/subscriptions","organizations_url":"https://api.github.com/users/vipulnsward/orgs","repos_url":"https://api.github.com/users/vipulnsward/repos","events_url":"https://api.github.com/users/vipulnsward/events{/privacy}","received_events_url":"https://api.github.com/users/vipulnsward/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T10:24:58Z","updated_at":"2015-01-26T10:24:58Z","body":"I think we should not mutate subject prefix in `add_env_info_to_subject_prefix`.\r\nCan you change it to just return ENV prefix if needed.  It can then be directly used like-\r\n\r\n```ruby\r\ndef add_subject_prefix message\r\n  return if subject_prefix.blank?\r\n  message.subject = \"[#{env_for_subject_prefix} #{subject_prefix}] #{message.subject}\"\r\nend\r\n```"}}