# Wrong rejection email is being sent

**URL:** <https://meta.discourse.org/t/wrong-rejection-email-is-being-sent/65150>\
**Category:** Bug\
**Created:** [26 Giugno 2017, 10:01pm UTC](https://meta.discourse.org/t/wrong-rejection-email-is-being-sent/65150 "2017-06-26T22:01:07Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)\
**Post date:** [28 Settembre 2017, 7:27am UTC](https://meta.discourse.org/t/wrong-rejection-email-is-being-sent/65150/10 "2017-09-28T07:27:16Z")

</div>

Sorry, I traced it.

Turns out that this particular user is @-mentioned in a post, and got an email, and so was compelled to reply.

But this code:

> <https://github.com/discourse/discourse/blob/cf9607a0cb5753bdae1c756752021aeb2df3f264/lib/new_post_manager.rb#L99-L108>

disallows the post and then sent over a very cryptic error message.

Perhaps this error message really needs to be changed to something like `You don't have permission to post your reply in this topic.`

EDIT: Something like this:

```plaintext
topic = Topic.unscoped.where(id: manager.args[:topic_id]).first

unless !topic.blank? && !topic.trashed?
  result = NewPostResult.new(:created_post, false)
  result.errors[:base] << I18n.t(:topic_not_found)
  return result
end

unless manager.user.guardian.can_create_post_on_topic?(topic)
  result = NewPostResult.new(:created_post, false)
  result.errors[:base] << I18n.t(:no_permission_to_post_in_topic)
  return result
end

```

---

_[View the full topic](https://meta.discourse.org/t/wrong-rejection-email-is-being-sent/65150)._
