1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change FROM email on Conversation Alerts?

Discussion in 'XenForo Questions and Support' started by craigiri, Sep 3, 2012.

  1. craigiri

    craigiri Well-Known Member

    As the admin, I end up getting lots of messages when user hit reply after getting an email notification of a conversation they are engaged in.

    Is there anyway to change the "from" of this message to a nulled email like "donotreply@mydomain.com" without changing that of other system emails?
  2. MagnusB

    MagnusB Well-Known Member

    ACP -> Options -> Email options
  3. craigiri

    craigiri Well-Known Member

    Hmm...am I missing something? That seems to set it globally....that is for all thread notifications as well as conversation notifications. I want to just have it different in the conversation notifications.
  4. MagnusB

    MagnusB Well-Known Member

    Sorry, might have misunderstood, but that option only controls the global email, AFAIK there is no way to change for just one part.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I hate that.

    Edit this file:


    Add the red code:

    	public function insertConversationAlert(array $conversation, array $alertUser, $action,
    		array $triggerUser = null, array $extraData = null, array &$messageInfo = null
    		if (!$triggerUser)
    			$triggerUser = array(
    				'user_id' => $conversation['last_message_user_id'],
    				'username' => $conversation['last_message_username']
    		if ($triggerUser['user_id'] == $alertUser['user_id'])
    		if ($alertUser['email_on_conversation'] && $alertUser['user_state'] == 'valid')
    			if (!isset($conversation['titleCensored']))
    				$conversation['titleCensored'] = XenForo_Helper_String::censorString($conversation['title']);
    			if (isset($messageInfo['message']) && XenForo_Application::get('options')->emailConversationIncludeMessage)
    				if (!isset($messageInfo['messageText']))
    					$bbCodeParserText = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Text'));
    					$messageInfo['messageText'] = new XenForo_BbCode_TextWrapper($messageInfo['message'], $bbCodeParserText);
    					$bbCodeParserHtml = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('HtmlEmail'));
    					$messageInfo['messageHtml'] = new XenForo_BbCode_TextWrapper($messageInfo['message'], $bbCodeParserHtml);
    				$emailTemplate = "conversation_{$action}_messagetext";
    				$emailTemplate = "conversation_{$action}";
    			$mail = XenForo_Mail::create($emailTemplate, array(
    				'receiver' => $alertUser,
    				'sender' => $triggerUser,
    				'options' => XenForo_Application::get('options'),
    				'conversation' => $conversation,
    				'message' => $messageInfo,
    			), $alertUser['language_id']);
    			$mail->queue($alertUser['email'], $alertUser['username'], array(), 'from@mail.com', 'from name');
    That should do it.

    This can be made into an addon instead of a file edit if you wish.
    taylor_smith likes this.
  6. craigiri

    craigiri Well-Known Member

    Wow, thanks Jake....
    As to it being an add-on. I guess that would survive updates easier but not that important to me. If others can use this, maybe you or someone can make it so.....
  7. Ludachris

    Ludachris Well-Known Member

    Sorry to bring this back from the dead, but another cool plugin idea would be to make it so if the user hits the reply button in the email, it automatically adds a reply to the Conversation. That might be quite a bit more involved for a plugin. I know Facebook does it this way, and with as much as forums rely on email alerts I think this would be a very elegant way to handle this common problem. I'll go ahead and request the add-on and suggest it for core.

    In the meantime I'll probably edit the file as Jake suggested, assuming the same instructions still work in 1.3?

Share This Page