ClipShare Community Forums  

Go Back   ClipShare Community Forums > ClipShare PRO - Version 4 > Feature Requests
Register FAQ Bug Tracker Members List Calendar Mark Forums Read

Feature Requests Post your wish list for future upcoming ClipShare versions.


Reply
 
Thread Tools Display Modes
Old 04-24-2009, 02:25 AM   #1
ryno
Member
|Forum Newbie|
 
Join Date: Sep 2007
Posts: 27
ryno is on a distinguished road
Default Email to User - Private Message

Howdy CS Folks...

I have searched around incessantly for a solution but can't find one. Like most people I'd love to have an email message sent when a member gets a private message.

I had this working in 2.6, but alas, no luck in 4+.

Any help would be great, thanks all.
ryno is offline   Reply With Quote
Old 04-24-2009, 03:06 AM   #2
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,013
dargre is on a distinguished road
Default

Quote:
Originally Posted by ryno View Post
Howdy CS Folks...

I have searched around incessantly for a solution but can't find one. Like most people I'd love to have an email message sent when a member gets a private message.

I had this working in 2.6, but alas, no luck in 4+.

Any help would be great, thanks all.
Basically I see send email code in file "compose.php".
If it doesn't work for you - can be a problem with email template.
But I'm not sure of that, you must ask other people that use default 4.xx and if it's working for them.
Personally I prefer to use my own code on my own site.
__________________

NUEVO Flash Player - most advanced video player for Clipshare and AVS
ClipShare mods by NuevoLab
Hosting solution recommended by NuevoLab
dargre is offline   Reply With Quote
Old 04-24-2009, 03:12 AM   #3
ryno
Member
|Forum Newbie|
 
Join Date: Sep 2007
Posts: 27
ryno is on a distinguished road
Default

There is send email code in compose.php, I've tinkered with it, but it doesn't seem to be working. The template seems fine, I've double checked names, coding, etc.

I can certainly get the correct info passed onto the email, my biggest problem seems to be triggering the email to actually send.
ryno is offline   Reply With Quote
Old 04-24-2009, 03:12 AM   #4
ryno
Member
|Forum Newbie|
 
Join Date: Sep 2007
Posts: 27
ryno is on a distinguished road
Default

Does it tie in with function.php at all?
ryno is offline   Reply With Quote
Old 04-24-2009, 03:25 AM   #5
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,013
dargre is on a distinguished road
Default

Quote:
Originally Posted by ryno View Post
Does it tie in with function.php at all?
Not so much, I don't think any function is a problem.
Man, it's so easy to check if php go to send email code...
Enough is to put few echo(), to check where it stops...
__________________

NUEVO Flash Player - most advanced video player for Clipshare and AVS
ClipShare mods by NuevoLab
Hosting solution recommended by NuevoLab
dargre is offline   Reply With Quote
Old 04-24-2009, 09:07 PM   #6
ryno
Member
|Forum Newbie|
 
Join Date: Sep 2007
Posts: 27
ryno is on a distinguished road
Default

Code:
$conn->execute("insert pm set subject='" .$subject. "', body='" .$details. "', sender='" .$username. "', receiver='" .$receiver_name. "', date='".date('Y-m-d H:i:s')."'");
                        $conn->execute("insert buddy_list set username='" .$username. "', buddy_name='" .$receiver_name. "'");
                        $rs_u = $conn->execute("select email, pm_notify from signup where username='" .$receiver_name. "' limit 1");
                        if ( $rs_u->fields['pm_notify'] == '1' && $config['pm_notify'] == '1' ) {
                                STemplate::assign("user_id", $_SESSION['id']);
                                STemplate::assign("user_name", $_SESSION['username']);
                                STemplate::assign("user_type", $_SESSION['type']);
                                STemplate::assign('sitename', $config['BASE_URL']);

                                $to = $rs_u->fields['email'];
                                $name = $config['admin_name'];
                                $from = $config['admin_email'];
                                $subj = $config['site_name']." - New Private Message";
                                $body = STemplate::fetch("mail/new_pm_notify.tpl");

                                mailing($to,$name,$from,$subj,$body);
                        }
There's two places where I'm seeing an anamoly. There is no "mail" folder or new_pm_notify.tpl file.

Second it looks like it's trying to pick up a value from "pm_notify" in the signup table, however there is no "pm_notify" in the table.

Perhaps I'm reading that all wrong, I'm not sure.

I tried the echo, but wasn't having much success in deciphering what it is to do with that. Appreciate your expertise Dargre...
ryno is offline   Reply With Quote
Old 04-24-2009, 10:21 PM   #7
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,013
dargre is on a distinguished road
Default

If there's no folder or no template for email, then you can't expect it will work.
I already mentioned: can be a problem with email template...

I checked 4.1.5 version, indeed there's no pm_notify field in signup table.
Once it was, seems ClipShare removed it, but forgot to update compose file...

But if you still want to send emails: you can always skip "IF" clause in php.
Also it is possible to set simple text for email subject and message instead of email template, and it will work then.

- D.
__________________

NUEVO Flash Player - most advanced video player for Clipshare and AVS
ClipShare mods by NuevoLab
Hosting solution recommended by NuevoLab
dargre is offline   Reply With Quote
Old 04-24-2009, 10:28 PM   #8
ryno
Member
|Forum Newbie|
 
Join Date: Sep 2007
Posts: 27
ryno is on a distinguished road
Default

Got it working.

In compose.php I commented out the built in send mail code:
Quote:
$conn->execute("insert pm set subject='" .$subject. "', body='" .$details. "', sender='" .$username. "', receiver='" .$receiver_name. "', date='".date('Y-m-d H:i:s')."'");
$conn->execute("insert buddy_list set username='" .$username. "', buddy_name='" .$receiver_name. "'");
//$rs_u = $conn->execute("select email, pm_notify from signup where username='" .$receiver_name. "' limit 1");
// if ( $rs_u->fields['pm_notify'] == '1' && $config['pm_notify'] == '1' ) {
// STemplate::assign("user_id", $_SESSION['id']);
// STemplate::assign("user_name", $_SESSION['username']);
// STemplate::assign("user_type", $_SESSION['type']);
// STemplate::assign('sitename', $config['BASE_URL']);
//
// $to = $rs_u->fields['email'];
// $name = $config['admin_name'];
// $from = $config['admin_email'];
// $subj = $config['site_name']." - New Private Message";
// $body = STemplate::fetch("mail/new_pm_notify.tpl");
//
// mailing($to,$name,$from,$subj,$body);
// }
And added this below:

Quote:

// send email notice to receiver
send_pm_notice($_SESSION[USERNAME],$receiver_name,$_REQUEST[subject]);
In function.php I added above //MAIL FUNCTION:

Quote:
//SEND PM NOTICE
function send_pm_notice($fromu,$tou,$title)
{
global $conn, $key;
$qry1="select email from signup where username='".$tou."'";
$rs1 = $conn->execute( $qry1 );
$email= $rs1->fields['email'];
$uname = $tou;

$email_path = "emails/pm_notify.tpl";
$from="you@you.com";
$subj = "Notice: New message from ".$fromu."!";

STemplate::assign('uname',$uname);
STemplate::assign('fromu',$fromu);
Stemplate::assign('title',$title);
$mailbody=STemplate::fetch($email_path);

mailing($email,$fromu,$from,$subj,$mailbody);

}
Last, create a "pm_notify.tpl" file and save it in ../templates/emails/. Have it read something like this:

Quote:
Howdy {$receiver_name}!

You have a new message from <strong>{$fromu}</strong> at <a href="http://www.yoursite.com">Yoursite.com</a>. You must log in to view your message.

<strong>Message Title: {$title} </strong>
<a href="{$baseurl}/mail/inbox">CLICK HERE TO READ THE MESSAGE! </a>
This is based on sheiking's code, just slightly modified. Thanks to him.

No doubt there's a better way to do it, but it's a start. Dargre, again, thank you for your help!

Last edited by ryno : 04-24-2009 at 10:31 PM.
ryno is offline   Reply With Quote
Old 06-02-2009, 10:50 PM   #9
Ronaldo1981
ClipShare Customer
|Forum Junior|
 
Ronaldo1981's Avatar
 
Join Date: Mar 2009
Posts: 76
Ronaldo1981 is on a distinguished road
Default

A message that you sent contained no recipient addresses, and therefore no delivery could be attempted.
__________________
Ronaldo1981 is offline   Reply With Quote
Old 07-14-2009, 10:27 PM   #10
gh0stmichael
Member
|Forum Regular|
 
Join Date: Jun 2009
Posts: 134
gh0stmichael is on a distinguished road
Smile Awesome!!!

this one works as a charm!

does anybody have an add-on code that will show the user avatar instead of his/her latest video upload? i saw it about msg.tpl but cant get it to work!
gh0stmichael is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT +1. The time now is 07:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright © 2006-2008 Envient. All Rights Reserved.

An Envient product.