Email notification template modification doesn't change email that is sent (reply_thread_gemailbody)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stcorp
    Member
    • Mar 2014
    • 43
    • 5.0.X

    Email notification template modification doesn't change email that is sent (reply_thread_gemailbody)

    Has anybody with 5.1.0 successfully modified the text of outgoing email notifications?

    Go to AdminCP -- Languages & Phrases -- Phrase Manager. Select "Email Body Text" in the "Phrase Type" dropdown. Go to page 3 (or tell it to show more phrases per page) and find "reply_thread_gemailbody". Click on "Edit" to the right of it.

    Fill in an English (US) translation for it. Change the text slightly from the original.

    Go to AdminCP -- Languages & Phrases -- Language Manager and click on "Rebuild All Languages" (out of an abundance of caution).

    Now, have yourself set to receive instant email notifications of replies to topics you have started. Get someone to reply to a topic you started in a forum.

    You'll get a notification email, but the email you receive will have the original default text for reply_thread_gemailbody, NOT the edited text you put in.

    This is the only phrase like this which we have found does not seem to be picking up the edits made to it. I'm guessing the code for email notifications is somehow bypassing the language selection and is always getting the default phrase.

    Support -- can you confirm?

    Thank you.
  • stcorp
    Member
    • Mar 2014
    • 43
    • 5.0.X

    #2
    Originally posted by statacorp
    Has anybody with 5.1.0 successfully modified the text of outgoing email notifications?

    Go to AdminCP -- Languages & Phrases -- Phrase Manager. Select "Email Body Text" in the "Phrase Type" dropdown. Go to page 3 (or tell it to show more phrases per page) and find "reply_thread_gemailbody". Click on "Edit" to the right of it.

    Fill in an English (US) translation for it. Change the text slightly from the original.

    Go to AdminCP -- Languages & Phrases -- Language Manager and click on "Rebuild All Languages" (out of an abundance of caution).

    Now, have yourself set to receive instant email notifications of replies to topics you have started. Get someone to reply to a topic you started in a forum.

    You'll get a notification email, but the email you receive will have the original default text for reply_thread_gemailbody, NOT the edited text you put in.

    This is the only phrase like this which we have found does not seem to be picking up the edits made to it. I'm guessing the code for email notifications is somehow bypassing the language selection and is always getting the default phrase.

    Support -- can you confirm?

    Thank you.
    Well, I've narrowed this down for myself, but haven't figured out the fix yet.

    In forums/core/vb/library/content/text.php, there is the following call:

    Code:
    $maildata = vB_Api::instanceInternal('phrase')->
            fetchEmailPhrases($mailPhrase, array(
                    $data['username'],
                    $currentNode['userinfo']['username'],
                    vB5_Route::buildUrl($node['routeid'] . '|nosession|fullurl', $routeInfo, array('goto' => 'newpost')),
                    vB_String::getPreviewText($currentNode['rawtext'], 1000),
                    vB::getDatastore()->getOption('bbtitle'),
                    vB5_Route::buildUrl('subscription|nosession|fullurl', array('tab' => 'subscriptions', 'userid' => $data['userid'])),
                    ),
                    array($starterTitle)
            );

    The fetchEmailPhrases() function takes an optional fourth argument for the language which unfortunately isn't being passed here. This means that the original phrase text for email notifications will always be fetched instead of any language modifications, including the default US English language.

    Unfortunately I don't yet know how to get the language id given the userid in the vBulletin source code...still working on that. Support -- maybe one of your developers can chime in here for a quick workaround?

    Note that I have modified the code above in one slight way unrelated to the problem at hand. In the call to 'getPreviewText', I added an optional second argument of 1000, to have 1000 characters of preview text sent with the notification email rather than the default 150 or 160 or so.
    Last edited by stcorp; Sat 29 Mar '14, 11:25am. Reason: fixed up spacing of the code

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      You should report this as a bug in the tracker: http://tracker.vbulletin.com

      Comment

      • stcorp
        Member
        • Mar 2014
        • 43
        • 5.0.X

        #4
        Originally posted by Zachery
        You should report this as a bug in the tracker: http://tracker.vbulletin.com
        Done. http://tracker.vbulletin.com/browse/VBV-12381

        It would be great if, before an official fix is implemented, a dev could stop by the forums or communicate to you the PHP required to grab the language id to pass to fetchEmailPhrases() so that we could work around this asap.

        Not being able to change the text of the notification emails sent to our users is a pretty big problem for us.

        Comment

        • Zachery
          Former vBulletin Support
          • Jul 2002
          • 59097

          #5
          We understand, its currently assigned to 5.1.2, and that would be the next build the developers are working towards. If a workaround becomes available I'll be happy to share it.

          I'm going to try to dig around the code and find any other examples of this and get it sorted out as well.

          Comment

          • Fhabio
            New Member
            • Sep 2015
            • 8
            • 5.1.x

            #6
            Originally posted by Zachery
            We understand, its currently assigned to 5.1.2, and that would be the next build the developers are working towards. If a workaround becomes available I'll be happy to share it.

            I'm going to try to dig around the code and find any other examples of this and get it sorted out as well.
            Hello Zachery

            2 years has been passed since this bug report, in JIRA there's no news on it, any ongoing about the fix on this issue that you could share with us?
            That's a really big issue if you run a forum in many languages, I really want a fix for it soon.. even if vbulletin's couldn't release an official fix yet, I would be glad if you could show how to fix it by myself.

            Thank you

            Comment

            • Zachery
              Former vBulletin Support
              • Jul 2002
              • 59097

              #7
              Looks like its assigned to 5.2.2

              Comment

              Related Topics

              Collapse

              Working...