Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
583 views
in Q2A Core by
Hello, I insert more scripts to qa-mention-detect.php that allows to send an notification by mail to mentioned user. E-mail is sent without problem but "link to question" not included in mail body.

Here are my script. Could anyone take a look? I really appreciate.

$mention = "INSERT INTO ^mentions (to_id, from_id, question_id, post_id, post_type, date)
                                VALUES (#, #, #, #, $, #)";
                    $mention = qa_db_query_sub($mention, $value, $from, $questionid, $postid, strtoupper($type[0]), time());

//--* modified code from here:

$question = qa_db_single_select(qa_db_full_post_selectspec(null, $postid));
                    $user = qa_db_single_select(qa_db_user_account_selectspec($value, true));
                    $handle = qa_get_logged_in_handle();                
                    $subject = isset($handle)?$handle." ".qa_lang_html('addon/mentioned_you')
                                            :qa_lang('main/anonymous')." ".qa_lang_html('addon/mentioned_you');                    
                    $sub = array( '^q_handle' => $user["handle"],
                                    '^q_title' => $question["title"],
                                    '^q_content' => $question["content"],
                                    '^url' => qa_path(qa_q_request($postid, $question["title"]), null, qa_opt('site_url'))
                                );
                    
                    qa_send_notification(null,
                                        $user["email"],
                                        null,
                                        $subject,
                                        "Hello, ".$user["handle"]."!\n\n".$subject,
                                        $sub);
related to an answer for: Notification Plugin available!
by
Can you show us what is in the lang string addon/mentioned_you? :)
by
This is just a message defined in qa_lang_addon.php which I created to declare all of my addon messages.

'mentioned_you' => 'mentioned you in the question',

1 Answer

0 votes
by
FIXED. Thanks anyway.
...