Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.1k views
in Q2A Core by
I am looking for a way to mention question title in every email send to users, email for related question, new comment , ...?

1 Answer

+2 votes
by
edited by

I'm not sure what is an email for a related question but in the case of a new comment I'm taking a look at the code right now and, if you're a bit flexible you can get around it without changing code.

If you comment a question post then you could use ^c_context as the question title. However, if the comment is for an answer then you won't see the question title but rather the answer text.

In the case of post queues and requeues (moderate and remoderate) you can use ^p_context. However, only for question posts will display the question title. This one will also work for flags.

EDIT

Based on comments, requirements are NOT flexible so it is needed the TITLE of the question when posting a comment in an ANSWER. Then you will have to perform a core hack in file qa-event-notify.php:

1. Locate this EXACT line https://github.com/q2a/question2answer/blob/3ea14aef81c6c5a0fe192ae083fffd03daa254b8/qa-include/plugins/qa-event-notify.php#L90

2. Replace it with these three lines:

// Core hack taken from http://question2answer.org/qa/43170?show=43185#a43185
//$context=qa_viewer_text($parent['content'], $parent['format']);
$context=$question['title'];

This solution will make ^c_context refer to the question title when commenting on answers

by
^c_context did not work for comment for answer and did not return question title.
by
I know... that is exactly what I said in my answer: "if the comment is for an answer then you won't see the question title but rather the answer text" :)
by
How can i access to question title in this situation?
by
I've added the core hack you need to apply. Make sure to follow the steps exactly as they are explained
...