Skip to Content Skip to Menu

User adress for the From: field of notification

  • Elodie
  • Elodie
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
15 years 9 months ago #88173 by Elodie
Hi,

The component works great for me, but in my case (users must only send to admin and vice-versa, not to other users), I need the user Email adress appear in the From: field of the notification mail, instead of the user name or nothing, so that admin and users can "Reply To" in their own mailer (so they can choose to use the website or their personal mailer for replys).

I'm sure there's a way to change this, but WHERE is the question for me, there's so much code ... I searched the forum but found nothing about it, maybe someone could help me ?

Also, if I could delete the "To:" field above the body message (new message), and have it replaced with "admin", and fill the To: variable with the admin adress, ONLY for the users ... that would be great too :)

Anyway, Thx for your work,

Elodie

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
15 years 9 months ago #88198 by slabbi
For notification messages you can specify the name and the email address of the recipient in the backend.

Nevertheless uddeIM adds a ReplyTo line, so when the user replies to a notification email by mistake, he - and not the admin - will get the message. This ensures that the text is still confidential.

You have to modify the code when you want to change this behavior. The first goal of uddeIM is to be as confidential with users messages as possible!

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

  • Elodie
  • Elodie
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
15 years 9 months ago #88233 by Elodie
Thx to answer quickly, but it's useless for me to put a name and adress of a recipient in the backend (email tab) as this data must be dynamic, according to the user who is sending the PM (should be something like "$usermail" and "$username" but don't know it -yet- in Joomla ??).

I found the ReplyTo line in includes.php, but of course I still need a variable as it should be the email adress of the sender (same as "$usermail").

And there's no need for confidentiality as users can ONLY send PM to Admin, and Admin back to users, but never users to users, so the admin reads every message sent to him...

So in my case, I need the From and ReplyTo correctly filled in the notification emails (to allow admin and users reply from the notification in their mailer), I understand the email configuration is set in includes.php, beginning at line 86 :

$header = "From: \"".$fromname."\" <".$frommail.">\n";
$header .= "Organization: ".$mosConfig_sitename."\n";
$header .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-type: text/plain; charset=".uddeIMgetCharsetMailalias($config->mailcharset)."\n";
$header .= "Content-Transfer-Encoding: 8bit\n";

$header .= $addheaders;

if ($config->mailsystem==1) { // mosMail
$ret = uddeIMmosMail($frommail, $fromname, $tomail, $subject, $message, false, NULL, NULL, NULL, $replyto, NULL);
} else { //php mail
$header .= "Reply-To: ".$replyto."\n";
$ret = @mail($tomail,$subject,$message,$header);


I think I need to replace "$fromname" and "$frommail" by the variable of the user logged in, I tried to find out HOW, but without any success for the moment ...

I know you didn't create uddeIM exactly for this purpose, but I would really appreciate some help to integrate this small modification :)

Thx

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
15 years 9 months ago #88267 by slabbi
You have to change the code in uddeIMdispatchEMN():

if(uddeIMsendmail($config->emn_sendername, $config->emn_sendermail, $var_toname, $var_tomail, $subject, $var_body, $replyto, $replytoname, "", $config)) {
// maybe a code here that the email cound not have been sent
}

replace $config->emn_sendername and $config->emn_sendermail.

Sorry, but I do not give more support for individual adaptions.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum