Community

Connecting WordPress People

Email link – page not found

gingerbooch 23 replies 1 view 2 readers

  1. New
    #1

    Hi everyone,

    Thank you for enhancing BP Messages. This plugin is pretty cool but I have an issue with the link to the discussion, found into every mail notification.

    Actually that link directs towards :
    yoursite.com/membres/USERNAME/bp-messa…

    Clicking on that link drives me to the discussion if I am already connected to the website on another tab.
    But while not connected to the website, this link drives me to a "page not found" error, instead of driving me to the connection page, then redirect to the thread.

    Is it due to a missconfiguration somewhere ? I didn't see anything like this in the settings.

    Anyway, back to the mail, if I change the link with "me" instead of "USERNAME", this is working. Connection then redirect to the thread. But I don't know how to change this because the link is made with the {{{thread.url}}} tag. That would be nice to be able to create {{{thread.number}}} to use it like this :

    yoursite.com/membres/me/bp-messages/?t…

    If there is a way to create our own tags, then I would like to create {{{sender.name}}} too.

    Thank you for reading 🙂

    More reactions: press the Down arrow
    1 view
  2. New
    Admin
    #2

    Hi there!

    Are you using some type of plugin to change current user slug to me on your site?

    Thanks!

    More reactions: press the Down arrow
  3. New
    #3

    Hi @admin,

    I am using Buddypress wich is able to redirect any « me » slug to current user « username ».
    I have been testing your link with the slug « me » instead of « username », by editing the html code inside the email (Right clic, inspect element).
    This is working. But this is good just for testing.

    My first question is « why is this happening ? »
    I suppose your link is normally working even if the mail recipient is offline from the website while clicking the link.

    I know the good slug working on my situation but I would need to create an additional tag for this. If possible can you tell me wich file(s) to look at please ?
    I think that more tags would be interesting for everyone. To customize the emails better. Like « sender.name » for example, or « thread.number » for my actual need ?

    Actually the best solution for me is to drive the user to the mailbox only, with the hard link :
    yoursite.com/members/me/bp-messages/

    Thank you for your help

    More reactions: press the Down arrow
  4. New
    Admin
    #4

    Hi there!

    All logic related to the notifications you can find in this file:
    /inc/notifications.php inside plugin folder.

    Let me know if I can help you to fix it.

    Anyway thanks on the feedback, i will definitely work on this and add more vaiables in next versions!

    Thanks! 🙂

    More reactions: press the Down arrow
  5. New
    #5

    Hi @admin,

    Thank you for the path and file name.
    Finally I decided to use a dedicated page for messaging.
    Is there a way to remove the access from BP Profile ?

    Then I had those values :
    /** File : /inc/notifications.php **/
    /** Place this under 'thread.url' […] **/
    'thread.id' => $thread_id,
    'sender.name' => $sender->display_name,

    Now I can specify the sender's name inside the mail, and I can use a hard link to only keep the thread number as a variable.
    You have a new message from {{{sender.name}}}
    Click on this link to go to the discussion :
    yourwebsite.com/messages_dedicated_pag…

    That works and solve my redirect after login problem. 🙂
    I have another issue 😀 The whole plugin is not translated to the website default language.
    I can translate it to french if you need.

    Thanks 😀

    More reactions: press the Down arrow
  6. New
    Admin
    #6

    Hi there!

    You can translate it here: translate.wordpress.org/projects/wp-pl…

    Thanks 🙂

    More reactions: press the Down arrow
  7. New
    #7

    Hi @admin,

    I am working on the french translation and I have a question.
    When you say "Are you sure you want to delete %d thread(s) and report?"

    Can you tell me what "report" means please ? I am not sure.

    Then how long does it take for my translations to be visible on the plugin ?

    More reactions: press the Down arrow
  8. New
    Admin
    #8

    Hi there, this string is from mass messaging feature, when you want to delete all messages that was creating by sending mass message.

    Report – is the report for the sent messages, like how many was read, etc.
    You should try mass messaging to understand 🙂

    The translations should be approved by wp localization editors community, you can ask them to approve or just export .po file at the bottom of that page:
    translate.wordpress.org/projects/wp-pl…
    and upload to your languages folder.

    More reactions: press the Down arrow
  9. New
    #9

    Hi @admin,

    Thank you for those details.

    "Are you sure you want to delete %d thread(s) and report?"
    Wouldn't it be logical to write "report(s)" instead of "report" ?
    Anyway, I wrote the translation in function of the original text, without the (s).

    I am done with the French translations of the plugin. I will try to translate the readme as well, when I have time.

    More reactions: press the Down arrow
  10. New
    Admin
    In reply to gingerbooch #10

    Hi there!

    Thanks for this!

    Wouldn’t it be logical to write “report(s)” instead of “report” ?

    This string always related to 1 report, so it should be like that 🙂

    Thanks again! 🙂

    More reactions: press the Down arrow
  11. New
    #11

    Hi @admin,

    I downloaded the .po and .mo files.
    I created a folder named "languages" into "bp-better-messages".
    I renamed the .po and .mo to "bp-better-messages-fr_FR.po" and "bp-better-messages-fr_FR.mo".

    I don't see any translation on the frontend. Is there anything else to do like registering the files somewhere ?

    Thank you

    More reactions: press the Down arrow
  12. New
    Admin
    #12

    Hi there!

    1. Try to upload to wp-content/languages/plugins/
    2. Ensure that your site using fr_FR locale.

    Thanks!

    More reactions: press the Down arrow
  13. New
    #13

    Hi @admin,

    Thanks for the tip ! The files are in this folder now, with many others, but that's not working. FYI, there was no previous translation files of bp-better-messages inside this folder.

    More reactions: press the Down arrow
  14. New
    Admin
    #14

    When downloading file here:
    translate.wordpress.org/projects/wp-pl…

    Did you choosed the option only matching the filter (near the export button)?

    More reactions: press the Down arrow
  15. New
    #15

    No I choosed « All current ».
    Is this wrong ?

    More reactions: press the Down arrow
  16. New
    Admin
    #16

    Yes, as translate not approved by wordpress editors you are downloading empty translation by choosing another option 🙂

    More reactions: press the Down arrow
  17. New
    #17

    That’s working thank you !! I love it !!
    ??

    Nothing about emoji is translated. Is it possible somewhere ?

    I have 2 other little issues ?

    – I would like to remove the underline under the menu buttons. I’m not sure if it comes from your css, or Buddypress, or my theme. May I customize it somewhere in your plugin’s directory ?

    – The last thing, it happens only with smartphone. When you touch the messaging, it goes to full screen. At this moment, the floating widget of google translate stops responding. Like if it was a layer under yours.
    Is there any chance to fix this ?

    Thanks for your support. ?

    More reactions: press the Down arrow
  18. New
    Admin
    #18

    Nothing about emoji is translated. Is it possible somewhere ?

    Will add in future versions.

    – I would like to remove the underline under the menu buttons. I’m not sure if it comes from your css, or Buddypress, or my theme. May I customize it somewhere in your plugin’s directory ?

    You should add CSS changes outside the plugin directory, for example in your theme or in plugin like: wordpress.org/plugins/simple-custom-css/

    – The last thing, it happens only with smartphone. When you touch the messaging, it goes to full screen. At this moment, the floating widget of google translate stops responding. Like if it was a layer under yours.

    The full screen mode was special developed to make chating from mobile more comfortable and its cant be disabled at the moment.

    More reactions: press the Down arrow
  19. New
    #19

    Many thanks.

    Can you please update your b-quote ?
    I think it was terrible ?

    Everything about « emoji » is not translated.

    Nothing about emoji is translated.

    More reactions: press the Down arrow
  20. New
    Admin
    #20

    haha ok!

    More reactions: press the Down arrow
  21. New
    #21

    Hi @admin,

    Thank you for adding this code to your core version :

    /** File : /inc/notifications.php **/
    /** Place this under 'thread.url' […] **/
    'thread.id' => $thread_id,
    'sender.name' => $sender->display_name,

    Can I ask you to add one more row please ?
    I have to put it back on every update and I think that could be usefull to others, just to say hello "name" in the notification mail 🙂

    'user.name' => $ud->display_name,

    Thanks !

    More reactions: press the Down arrow
  22. New
    Admin
    #22

    hi there, @gingerbooch.

    You can filter that variables with filter bp_better_messages_notification_tokens.

    Thanks!

    More reactions: press the Down arrow
  23. New
    #23

    Hi @admin,

    Thanks for this tip. I tried many times to filter that variable using bp_better_messages_notification_tokens
    I was highly interested on finding a way to use it, I managed to filter easy things previously but this time it is inside an array and I can't find a solution.
    This task is abobe my skill.

    Can you help me please ?

    Thank you

    More reactions: press the Down arrow
  24. New
    #24

    Ok I got it ! Thanks for the filter 🙂

    function add_tokens($arr, $ud, $sender, $thread_id) {
    $arr = array(
    'messages.html' => $messageHtml,
    'messages.raw' => $messageRaw,
    'user.name' => $ud->display_name,
    'sender.name' => $sender->display_name,
    'thread.id' => $thread_id,
    'thread.url' => esc_url( BP_Better_Messages()->functions->get_link( $user_id ) . '?thread_id=' . $thread_id ),
    'subject' => sanitize_text_field( stripslashes( $messages[ 0 ]->subject ) ),
    'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( array(
    'user_id' => $user_id,
    'notification_type' => 'messages-unread',
    ) ) )
    );
    return $arr;
    return $ud; ///
    return $sender; ///
    return $thread_id; ///
    }
    add_filter( 'bp_better_messages_notification_tokens', 'add_tokens', 10, 4);

    More reactions: press the Down arrow
0