News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF User Email System

Started by SMFHacks.com Team, July 01, 2006, 04:28:21 PM

Previous topic - Next topic

Vinspire

Quote from: marinelife on September 15, 2006, 07:50:21 AM
nothing in the profile area as far as emails go. I check marked the email permission and it still does not work

1. Admin CP -> Members -> Permissions ( You might not be able to see this if you are using custom theme where it need manual installation to get it to work )



2. As an Admin

Click on members name that you want to see their email -> Modify Profile -> Account Related Settings


marinelife

yeah that is the permission box I have and if I check it the user still can not send an email, I will try to reinstall the mod

marinelife

on here you have useremail.zip file and on your site you have 18useremail.zip are there any differences in them

vbgamer45

Not really. The main thing todo is check that every group that you want to send email has permission to do so.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

carbonize

Great mod. Maybe you could tie up with HarzeM about getting it to work with his CAPTCHA mod.
C a r b o n i z e

Chad

Problem I have with this mod is that when a user sends another user an email, the FORUM EMAIL address, namely, mine, gets put in there as the person who sent the email and these people REPLY to the email and send me the response... lol  I then have to explain to them that I didn't send it and they need to go to the site and look the member up who did then send them the response.
Could we have 3 links in the email that is sent?
1 that is a link to the senders profile on the site.
1 that is a link directly to Private Message the user.
1 that is a link to send the user an email using the email system.


marinelife


Daiima

Hello,

I am getting some trouble with this mod.
When trying to mail a member, a message: Cannot load 'main' template is displayed.
I installed it automatically on my SMF 1.1RC3 and then looked for misinstalling in all files (I found some, by the way), but even after this check I do not manage to make it run. I use it with PDX-DK theme.

Thanks

Daiima

Hello, I up as this problem is very annoying and because I just saw that this error comes with another one:
2: call_user_func(UserEmailMain) [<a href='function.call-user-func'>function.call-user-func</a>]: First argument is expected to be a valid callback
File: /(...)/forum/index.php
Line: 142
?action=useremail;u=1


If you can help me solve it, it would be great! Thanks.

violaceous

This is an awesome mod (it should definately become standard in SMF), the one thing I noticed immediately is that it seems to display the person's username instead of their display name. I think it'd be better if it showed display names.

Quote from: Chad on October 15, 2006, 09:25:33 AM
Problem I have with this mod is that when a user sends another user an email, the FORUM EMAIL address, namely, mine, gets put in there as the person who sent the email and these people REPLY to the email and send me the response... lol  I then have to explain to them that I didn't send it and they need to go to the site and look the member up who did then send them the response.
Could we have 3 links in the email that is sent?
1 that is a link to the senders profile on the site.
1 that is a link directly to Private Message the user.
1 that is a link to send the user an email using the email system.
seems like a good idea too

violaceous

#50
Quote from: violaceous on October 31, 2006, 09:10:03 PM
This is an awesome mod (it should definately become standard in SMF), the one thing I noticed immediately is that it seems to display the person's username instead of their display name. I think it'd be better if it showed display names.
I went into User_Email.php and replaced all the instances of memberName with realName to get it to show the display name instead of the username, it seems to work fine :)

edit: after a little more tweaking to User_Email.php I got the emails to look like this:
QuoteHello anotherUser,

The following is an email sent to you by violaceous via your account on ForumName. If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address at [email protected]

The message sent to you follows:
--------------------------------------------------

this is the message

okay?

--------------------------------------------------
violaceous's profile: hxxp:domain.com/forum/index.php?action=profile;u=6 [nonactive]
ForumName: hxxp:domain.com/forum [nonactive]
Basically, it uses display names instead of usernames, the message is separated a little more from the surrounding text, and there's links back to the forum as well as to the sender's profile page

Here's the modified User_Email.php (feel free to use it or not :P )
<?php
/*
User Email System
Version 1.1
by:vbgamer45
http://www.smfhacks.com
*/

if (!defined('SMF'))
die('Hacking attempt...');

function 
UserEmailMain()
{
global $context$mbname$webmaster_email$ID_MEMBER$txt$db_prefix$sourcedir$scripturl$boardurl;

//Check if the current user can send emails
isAllowedTo('send_useremail');

if(isset($_GET['sa']))
{

if($_GET['sa'] == 'save')
{

@$subject $_POST['subject'];
if($subject == '')
fatal_error('You need to enter a subject.',false);
@$message $_POST['message'];
if($message == '')
fatal_error('You need to enter a message.',false);


@$userid = (int) $_POST['userid'];
if($userid == '')
fatal_error('No user selected.',false);

$request db_query("SELECT realName, emailAddress FROM {$db_prefix}members WHERE ID_MEMBER = $userid LIMIT 1"__FILE____LINE__);
$row mysql_fetch_assoc($request);

$rec $row['realName'];
$rec_email $row['emailAddress'];

mysql_free_result($request);

$request2 db_query("SELECT realName, emailAddress FROM {$db_prefix}members WHERE ID_MEMBER = $ID_MEMBER LIMIT 1"__FILE____LINE__);
$row2 mysql_fetch_assoc($request2);
$sec_name $row2['realName'];
$sec_email $row2['emailAddress'];
mysql_free_result($request2);

$m ="Hello $rec,

The following is an email sent to you by 
$sec_name via your account on $mbname. If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address at $webmaster_email

The message sent to you follows:\n--------------------------------------------------\n\n"
;
$m .=  strip_tags($message);
$m .= "\n\n--------------------------------------------------\n";
$m .= $sec_name "'s profile: " $scripturl "?action=profile;u=" $ID_MEMBER;
$m .= "\n" $mbname ": " $boardurl;
//For send mail function
require_once($sourcedir '/Subs-Post.php');

//Send email to member
sendmail($rec_email$subject$m);

//Check if it should send the sender a copy of email
@$sendcopy $_POST['sendcopy'];
if($sendcopy == 'ON')
{
sendmail($sec_email$subject$m);
}

//Show template that mail was sent
loadtemplate('User_Email');

//Load the main User Email template
$context['sub_template']  = 'send';

//Set the page title
$context['page_title'] = $mbname ' - Email sent.';

}
}
else
{
$u = (int) $_GET['u'];

$request db_query("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER = $u LIMIT 1"__FILE____LINE__);
$row mysql_fetch_assoc($request);
$context['user_email_name'] = $row['realName'];
$context['user_email_id'] = $u;

//Load the main User Email template
loadtemplate('User_Email');

//Load the main User Email template
$context['sub_template']  = 'main';

//Set the page title
$context['page_title'] = $mbname ' - ' $txt['user_email_title'];
}
}
?>

I didn't change any conditional statements so there shouldn't be any security concerns introduced (tested on 1.1 RC3)

vbgamer45

Updated mod so it uses the displayname instead of the username.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

violaceous

I've also noticed that it doesn't seem to check the member's permission for "Hide email address from public?"

If checked, then the link isn't public, however it's still possible (and really easy) to manually enter the link in your browser's address bar to get to the send email form for the member in question, and then send them an email

vbgamer45

Quote from: violaceous on November 06, 2006, 08:50:31 PM
I've also noticed that it doesn't seem to check the member's permission for "Hide email address from public?"

If checked, then the link isn't public, however it's still possible (and really easy) to manually enter the link in your browser's address bar to get to the send email form for the member in question, and then send them an email
Good find I will fix that for next release.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

bebe

hmm.. i have problem with version 1.1.

My current forum still using version 1.0 and no errors at all, but i set up another forum with the version 1.1 and i get the error as follows whenever i typed at the all fields and click submit.
QuoteAn Error Has Occurred!
You need to enter a message.

Once i click 'Back', all the message that i just typed still showing there.

FYI, i'm using 1.1RC3, patched, installed the Reason for Editing, Contact Page mod. This is the 3rd mod i installed and i get the error.

I don't know what files are related to this error. Any helps would be appreciated.

vbgamer45

Fixed.

Added Guest email support as well. Requires a guest to enter their email address.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

bebe

Oh, not sure what you've done, version 1.1.2 is error free. Thanks! :D

violaceous

Quote from: vbgamer45 on November 06, 2006, 09:38:03 PM
Quote from: violaceous on November 06, 2006, 08:50:31 PM
I've also noticed that it doesn't seem to check the member's permission for "Hide email address from public?"

If checked, then the link isn't public, however it's still possible (and really easy) to manually enter the link in your browser's address bar to get to the send email form for the member in question, and then send them an email
Good find I will fix that for next release.
hmm.... admins by default overide all the permissions...... however when I click on the email link now (and the email link is shown for everyone)......... it'll give me a "cannot email this user" error (for the users who've disabled it)

Is there a way to change the permission checking so admins can still email the user regardless

thanks :)

violaceous

Quote from: violaceous on November 08, 2006, 09:55:12 PM
Quote from: vbgamer45 on November 06, 2006, 09:38:03 PM
Quote from: violaceous on November 06, 2006, 08:50:31 PM
I've also noticed that it doesn't seem to check the member's permission for "Hide email address from public?"

If checked, then the link isn't public, however it's still possible (and really easy) to manually enter the link in your browser's address bar to get to the send email form for the member in question, and then send them an email
Good find I will fix that for next release.
hmm.... admins by default overide all the permissions...... however when I click on the email link now (and the email link is shown for everyone)......... it'll give me a "cannot email this user" error (for the users who've disabled it)

Is there a way to change the permission checking so admins can still email the user regardless

thanks :)

The 2 parts in User_Email.php that said:
if($row['hideEmail'] == 1)
fatal_error('This user has hidden their email and you can not email them.',false);

I just changed to:
if($row['hideEmail'] == 1 && !$context['user']['is_admin'])
fatal_error('This user has hidden their email and you can not email them.',false);

This lets admins overide the setting, which seems to make more sense since admins overide all other permissions anyways

vbgamer45

Added violaceous idea to allow admin's to send mail even if user hides email.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: