Version: 1.0.0, by Shishir
Developer Last Online: Jan 2015
Category: Profile Enhancements -
Version: 3.7.2
Rating:
Released: 08-20-2008
Last Update: Never
Installs: 52
Uses Plugins
Translations
No support by the author.
Information:
This modification is actually based on several requests I saw here and especially after this one. I mean, how can I neglect a request with "If someone makes one, I'd be willing to contribute."
What it does is simple. When someone makes a visitor message in Profile it will notify the user via email that a new message has been posted. If the message is a new message then the email will contain the message as well. If it is an ajax message then only a simple email with notification will be made.
Feature:
> Sends an Email Notification to the user when a visitor message is posted.
Install instruction:
==> Import XML file (as product): AdminCP > Plugins & Products > Manage Products > [Add/Import Product]
==> Go to: AdminCP > vBulletin Options > vBulletin Options > User Profile: Visitor Messaging Options and Select to your preference.
Current Version:
1.0.0
If you like this hack please click INSTALL. Support will only be provided to those who click Install.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
to those who want the user could choose to receive or not emails, I did this:
I created a profile field called: "Receive Email Notifications on Visitor Messages"
The identification of the field was 'field5' (you can see this after you create the profile field, I created a radio button with two options: 'Yes' and 'No')
then, edit the two plugins of this product:
find (the first line of the plugin):
Code:
if($vbulletin->options['VMEN_active'] == 1)
and replace for:
Code:
if($vbulletin->options['VMEN_active'] == 1 AND $userinfo['field5'] == 'Yes')
pay attention to use the proper field identification (in my case was field5)
now, only those who have choosen 'Yes' will receive the email
another simple addition to have the link to the profile in the email is:
change this:
Code:
. 'Thanks.';
to this:
Code:
. "You can see your profile <a href=\"http://YOURDOMAIN/forum/member.php?u=" . $userinfo['userid'] . "\">here</a>" . "\n\r" . 'Thanks.';
make sure to use your own domain instead of "YOURDOMAIN"
ps: the only problem is that the email isnt at html form... so it will need to add some parameters to the vbmail function which is called at the end (I will try to investigate to understand how to do this)
Hello, this is a problem for me as well. I get the actual a href html code in the email like:
I can't figure out how to get rid of that so it just allows clicking on the word here or even if it just gave the link without the code that would be fine as well. I tried removing the a href code part from the xml but that caused errors to show when someone posted a profile message. Probably something screwy going on with the quotation marks or slashes. Any assistance would be greatly appreciated.
I was also getting the emails sent in text format...
To get them to send correctly I just used the PHP mail() function instead of the built in one.
PHP Code:
mail($userinfo['email'], 'You Have a New Profile Message', $VMEN_message, 'From: '.$vbulletin->options['VMEN_reply'].PHP_EOL.'Content-type: text/html');
If anyone has a better solution I would be interested in seeing it. :up:
I'm interested in getting the contents of the visitor message in the email. Are you saying this is what you were able to accomplish?
You're replacing
Code:
vbmail($userinfo['email'], 'You have a New Profile Message', $VMEN_message, false, $vbulletin->options['VMEN_reply'], '');
With
Code:
mail($userinfo['email'], 'You Have a New Profile Message', $VMEN_message, 'From: '.$vbulletin->options['VMEN_reply'].PHP_EOL.'Content-type: text/html');
But still doesn't show any message wehn recieving the e-mail. Here is the example:
HTML Code:
You have a new Profile message from Admin
--------------------------------------------
--------------------------------------------
To see or reply this message, please go to your profile on http://www.forum_name.com/member.php?u=1
If you forgot your password, please click here: http://www.forum_name.com/login.php?do=lostpw
To unsuscribe from recieving instant e-mail notifications, please click here: http://www.forum_name.com/profile.php?do=editoptions
Thank you.
Any ideas how to solve this issue or how to get the message posted on profile to show up in the e-mail?
Thanks for your mod Shishir. However, apart from lack of those features, I did notice another problem with this mod. I noticed that when a person edits a visitor message, the member with the profile recieves another Email notification telling them that there is a new visitor message on their profile. This happens even if an admin edits the visitor message, so the member with the profile may get Email notifications not knowing why they're recieving them.
I'm hoping that a rebuild of this mod would eradicate this problem as well as add on the other required features.
Fix for this:
Find:
Code:
if($vbulletin->options['vmen_active'] == 1 )
Change to:
Code:
if($vbulletin->options['vmen_active'] == 1 AND !$_REQUEST['vmid'])
if($vbulletin->options['vmen_active'] == 1 AND !$_REQUEST['vmid'])
I've got a field to make user's choose if they want to recieve or not emails when someone posted on their profile, like this:
Code:
if($vbulletin->options['VMEN_active'] == 1 AND $userinfo['field10'] == 'Yes')
My question is:
- How do I merge your solution :
Code:
if($vbulletin->options['vmen_active'] == 1 AND !$_REQUEST['vmid'])
with my modification:
Code:
if($vbulletin->options['VMEN_active'] == 1 AND $userinfo['field10'] == 'Yes')
Also it will be very good if you know how to extract the message posted on the profile, the issue I have above (https://vborg.vbsupport.ru/showpost....5&postcount=67). Users recieves the e-mail but without the message from their profile!