Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi George I haven’t tested the plugin in that configuration yet. Is that site a test site and I can have access to it to play around?

    If not you will have to wait for me a bit longer until I got some time to create it locally.

    Regards

    Thread Starter gebar

    (@gebar)

    No, unfortunately it is not a test site.

    I can tell you though that in Buddypress file bp-core-filters.php there are two functions, bp_core_activation_signup_blog_notification and bp_core_activation_signup_user_notification, that filter wpmu_signup_blog_notification.

    I noticed the problem in two emails, the activation email and the notification for the successful setup of a new site after activation.

    I think that the second one does not even pass through Buddypress, its message (text body) is set at the Network Dashboard: Settings – New Site Settings – Welcome Email (for user with blog) and Welcome User Email (for user without blog). I have only tested the Welcome Email.

    Also, two image links a had set at the footer of the template (social icons) arrived fine.

    Thanks for looking into it.

    Hi Gebar, Im testing this and seems to work on my end.
    What you mean is that the whole email is plain text or just the urls?

    Becuase I just installed latest version of bp in a multisite. Registered a new user + site and I got all emails ok with the html template I configured.

    Regards

    Thread Starter gebar

    (@gebar)

    No, the email is in html, but the links are plain text, they are missing the <a></a> tag, so you can’t click on them and be taken to the url. While, as I said, the tag exists for the social icon links I set up at the footer of the template.

    The problem also exists in the emails the admin receives when a new member is registered, that allow him to disable the notifications for new members or sites registrations.

    You mean that in your install the links are ok, they have the <a> tag?

    That’s strange, because as I said, one of the emails (the one sent to the new user after activation) is sent directly by WordPress, without any interference by BuddyPress.

    So, what can we do now? Any ideas?

    I think I know what you mean now. I thought that not html email was sending at all.
    The thing is that Email templates plugin doesn’t change the content itself, it just wraps it into a html template.

    So the links are not send with any <a href=""> tag. If your email client who usually convert those into links. What email client do you use?

    For example I use Gmail or MacOS Mail , both convert those into links. I was getting clickable links before the html template also.

    Regards

    Thread Starter gebar

    (@gebar)

    OK, I checked this out, and you are right.

    I looked at the message source of a plain text and a html email coming from my site. In both there is no <a> tag, but in the plain text email the links are converted to clickable while in the html they are not.

    So I added the tag to the body of the messages, and hopefully the links will arrive in clickable form.

    I will mark this thread resolved. (In fact, I should have checked before even opening it.)

    Thanks for your prompt response.

    Thread Starter gebar

    (@gebar)

    In case anyone else encounters the same problem, WordPress has a very handy function for this purpose: make_clickable. It takes strings, and if it finds any links in them, does what it’s name says.

    Put this in your functions.php or, for multisite, in a file in mu-plugins directory.

    add_filter( 'wp_mail', 'my_wp_mail_filter' );
    function my_wp_mail_filter( $args ) {
    
    	$message = $args['message'];
    	$clickable_message = make_clickable ( $message );
    
    	$new_wp_mail = array(
    		'to'          => $args['to'],
    		'subject'     => $args['subject'],
    		'message'     => $clickable_message,
    		'headers'     => $args['headers'],
    		'attachments' => $args['attachments'],
    	);
    
    	return $new_wp_mail;
    }

    It will make links clickable in all your emails.

    Thanks for the tip!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Losing links’ is closed to new replies.