This topic may belong in #dev. Apologies if it is misplaced.
I am trying to develop a patch to core that will allow for certain added functionality. I have found the relevant function in the relevant file to make my changes, however I am unsure of how to access information that is in the function.
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'] = "email@example.com" result['CC'] = reply_by_email_address else result['Reply-To'] = from_value end
I want to replace
firstname.lastname@example.org 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.
Thank you for any suggestions on how to develop.