Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2011, 10:07 PM
wayne.richards@ wayne.richards@ is offline
 
Join Date: Jul 2008
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Change PM Default Email Address

Is there any way i can change the address that PM's appear to come from without changing the default email address used by contact us etc?

It doesnt matter how many times i put "DO NOT REPLY TO THIS EMAIL" in the pm notification mail sent out to members i still get loads of replies in my inbox!
Reply With Quote
  #2  
Old 12-25-2011, 11:35 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you look at includes/functions.php there's a function named vbmail() that has a $from parameter so you can specify from address. You can put an address as the default for that parameter and it will be used for all emails sent, or you can find the calls to vbmail() used for private messages (in includes/class_dm_pm.php), and add the "from" parameter there.
Reply With Quote
  #3  
Old 12-25-2011, 08:13 PM
wayne.richards@ wayne.richards@ is offline
 
Join Date: Jul 2008
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
If you look at includes/functions.php there's a function named vbmail() that has a $from parameter so you can specify from address. You can put an address as the default for that parameter and it will be used for all emails sent, or you can find the calls to vbmail() used for private messages (in includes/class_pm_dm.php), and add the "from" parameter there.
Any idea what the line would look like in "class_pm_dm.php" as i cant seem to find any reference to mail in there.
Reply With Quote
  #4  
Old 12-25-2011, 09:28 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, it's actually class_dm_pm, but you probably figured that out...

Anyway, there's this code around line 589 (in version 4.1.9):

Code:
if (($user['options'] & $this->registry->bf_misc_useroptions['emailonpm']) AND $user['usergroupid'] != 3 AND $user['usergroupid'] != 4)
{
	$touserinfo =& $user;
	$plaintext_parser->set_parsing_language($touserinfo['languageid']);
	$plaintext_message = $plaintext_parser->parse($this->fetch_field('message'), 'privatemessage');

	eval(fetch_email_phrases($email_phrases['pmreceived'], $touserinfo['languageid'], '', 'email'));
	vbmail($touserinfo['email'], $emailsubject, $emailmessage, false, 'no_reply@foo.com');
}

That sends the "you have a pm" email. I added the part in red (the 'false' is another default parameter that comes before the from address).
Reply With Quote
  #5  
Old 12-25-2011, 10:58 PM
wayne.richards@ wayne.richards@ is offline
 
Join Date: Jul 2008
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess i replace with the "no_reply@foo.com" the email i want it to appear email come from?
Reply With Quote
  #6  
Old 12-25-2011, 11:20 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wayne.richards@ View Post
I guess i replace with the "no_reply@foo.com" the email i want it to appear email come from?
Yeah, sorry, I should hav mentioned that. I was using that for testing but you can put anything you want there.
Reply With Quote
  #7  
Old 12-26-2011, 04:23 PM
wayne.richards@ wayne.richards@ is offline
 
Join Date: Jul 2008
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Superb! have done it and its working a treat, now if anybody answeres the PM notification email they get a response telling them.

Thanks very much for all your help, you have prevented me getting anymore headaches from stupid users.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:41 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04826 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete