Download & Extend

Using User name and registration email address to send email

Project:Author Contact
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:JmsCrk
Status:active

Issue Summary

Hi,
is it possible for authenticated users to send email to node author without typing their user name and email address?
Since I set up the author contact block only visible for authenticated users, is it possible to use their user name and email address for the contact form so the users don't have to type these information again, but more importantly, the users can not use a fake email address to abuse the node author, and the sender can also be tracked.

Comments

#1

Category:support request» feature request
Assigned to:Anonymous» JmsCrk

Sounds like a good idea.

#2

Thanks. I like this module very much. It's easy for the users to use and it comes in a block so that I can put that at the bottom at the page. It's brilliant! This is a potential problem I spot, the other one is flood control but we are not talking about that here.
The private message is good too, but it doesn't come with block out of the box like this one where I can put it wherever I like, so the users have to click the author's name and then send a message. That's too many clicks. and the "send this user a message" shows in every single user page, even on my own page. Why do I want to send myself a message.
This is why I like this module so much. It can only get better if this feature is added to protect the author......and flood control.
Thank you very much.

#3

Thanks. I like this module very much. It's easy for the users to use and it comes in a block so that I can put that at the bottom at the page. It's brilliant! This is a potential problem I spot, the other one is flood control but we are not talking about that here.
The private message is good too, but it doesn't come with block out of the box like this one where I can put it wherever I like, so the users have to click the author's name and then send a message. That's too many clicks. and the "send this user a message" shows in every single user page, even on my own page. Why do I want to send myself a message.
This is why I like this module so much. It can only get better if this feature is added to protect the author......and flood control.
Thank you very much.

#4

Subscribing, greetings, Martijn

#5

I'm using the dev version. This will automatically fill in the values of the FROM (user name and email). I haven't test it with an actual email since my local site isn't configured for email. Let me know if it works for you.

'//kh added' is where I added my code. I hid some of the options with // so ignore if you want them. I added #access to hide the values.

function authorcontact_form() {
    $node = node_load(arg(1));

global $user; //kh added
    $form['sendername'] = array(
            //'#title'   => t('Your Name'),
//'#size' => variable_get('authorcontact_form_width', 15),
            //'#type' => 'textfield',
'#type' => 'item', //kh added
'#value' => $user->name, //kh added
//'#access'  => false, //kh added
            //'#required' => true
    );

    $form['senderemail'] = array(
            //'#title' => t('Email'),
            //'#type' => 'textfield',
'#type' => 'item', //kh added
//'#size' => variable_get('authorcontact_form_width', 15),
'#value' => $user->mail, //kh added
             '#access'  => false, //kh added
//'#required' => true
    );

#6

I noticed that #access blocks the value altogether. It may be better to use #type => hidden to hide it in the form.