# Watch topic using email address without requiring registration

**URL:** https://meta.discourse.org/t/watch-topic-using-email-address-without-requiring-registration/214318
**Category:** Feature
**Created:** [January 9, 2022, 9:23pm UTC](https://meta.discourse.org/t/watch-topic-using-email-address-without-requiring-registration/214318 "2022-01-09T21:23:16Z")
**Posts on this page:** 1
**Showing post:** 31

<div class="post-metadata">

### Author: ![alangibson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alangibson/32/245888_2.png) [@alangibson](https://meta.discourse.org/u/alangibson)
#### Post date: [January 15, 2022, 12:07pm UTC](https://meta.discourse.org/t/watch-topic-using-email-address-without-requiring-registration/214318/31 "2022-01-15T12:07:47Z")

</div>

I’ve spent some quality time digging through the code. I think something like this (warning: very likely not working as I haven’t tried it yet) would work to allow the user to post a reply with just an email. I’d appreciate any comments you have.

I’m especially not sure if this is the best way to create a staged user. I haven’t found any method that specifically creates staged users though.

```plaintext
class SomePluginController < ApplicationController

  # Make sure there is a staged user in the db
  def ensure_user

    # See if staged user exists
    user = User.where(staged: true).with_email(params[:email].strip.downcase).first

    # Create a staged user manually
    if !user
      user = User.new
      user.staged = true
      user.email = params[:email]
      user.active = false
      user.save!
    end
    
    user
  end

  # Watch topic as a staged user
  def staged_watch

    user = ensure_user

    topic = Topic.find(params[:topic_id].to_i)
    TopicUser.change(user, topic.id, notification_level: params[:notification_level].to_i)

  end

  # Reply to topic as a staged user
  def staged_reply
 
    user = ensure_user

    manager = NewPostManager.new(user,
                             raw: params[:body],
                             topic_id: params[:topic_id])
    result = manager.perform

  end

end

```

---

_[View the full topic](https://meta.discourse.org/t/watch-topic-using-email-address-without-requiring-registration/214318)._
