What I would like is to access the email address of the user who posted the topic that the function is being accessed on.
Here is the code snipet, found in line 148 of lib/email/message_builder.rb:
if allow_reply_by_email?
result['X-Discourse-Reply-Key'] = reply_key
result['Reply-To'] = "test1@test.com"
result['CC'] = reply_by_email_address
else
result['Reply-To'] = from_value
end
I want to replace test1@test.com with the email address of the author of the topic.
I have found some documentation on API that seems very relevant, but no ālist of functionsā as such. I donāt believe that what Iām looking for is called a āhookā, and the list of hooks doesnāt appear relevant.
I understand that my question comes out of an incompetence in Rails programming, and I plan on studying Rails more over time. In PHP programming, which I am familiar with, I am able to access this information using some debugging tool like XDebug for PHP where I can āstopā the code and see what variables are accessible. I havenāt figured out how to use such a tool for Rails yet.
and then typed in var all from sidekiq. This shows all of the variables, and @opts seemed the relevant one. However, it does not contain anything like the senderās email address, though it does contain post id (14). I think the way to pull this is to:
Ask what the user who posted post_id 14
Ask what the email address of that user is
Export it as a variable.
Which brings me back to the original point that I have to figure out what function can do thisā¦