PDA

View Full Version : vb 3.6.x - how to change welcome email sender?


64North
06-25-2006, 06:57 AM
I am tinkering with 3.6.x in the pre-launch stage of my new forum, and I can't seem to figure out where to change the sender info of the confirmation emails and any other email sent by the board.

Right now it seems to use the board title variable, but I don't want that as it looks rather silly:

From: "Outdoor Digital Photo Online - Digital Photography of the Great Outdoors! at Outdoor Photo Net \(OPN\)" <actual email address here>

Which template do I have to change to remove the title and just use something I will hardcode into that template?

Thanks in advance for your time and consideration.

rogersnm
06-25-2006, 07:26 AM
Search for the phrase welcomemail you should then find a phrase that looks like "Welcome to $vboptions[bbtitle]!" Then you can just edit it to "Welcome to Our Forums" or whatever you want.

64North
06-25-2006, 08:26 AM
rogersnm, thanks for your quick reply, but that's not it.
There is nothing wrong with the welcome email subject or body. It's the sender that's screwed up. Let's assume you send me an email from your regular email account, the sender will show up as "Nick Rogers" <whatever@yourisp.com>. That's all good, except for me the sender is $vboptions[bbtitle], which makes it "Outdoor Digital Photo Online - Digital Photography of the Great Outdoors! at Outdoor Photo Net \(OPN\)" <actual email address here>, which is not what I would like it to say. Let's assume I want to change "Outdoor Digital Photo Online - Digital Photography of the Great Outdoors! at Outdoor Photo Net \(OPN\)" <actual email address here> to "Nick Rogers" <whatever@yourisp.com>, where would I need to do that?

rogersnm
06-25-2006, 08:42 AM
so, lets get this straight. You have an email it syas it's from "Outdoor Digital Photo Online - Digital Photography of the Great Outdoors!" instead of "webmaster@outdoor-photo.net". From what i can see it's the subject you want changing. IT's currently set for "[bbtitle] <[email adress]>" where as you want it to be "[name] <[email adress]>". It looks like your using outlook which seems to have asigned the [bbtitle] as the name of that contact. I think it's just for you.

64North
06-25-2006, 09:27 AM
I am using Eudora, but even if accessing the email through webmail the problem is the same, here is the email header:


Return-path: <email@domain.net>
Envelope-to: email@domain.net
Delivery-date: Sun, 25 Jun 2006 03:43:02 -0400
Received: from xxx by xxx.xxx.xxx with local (Exim 4.52)
id 1FuPGo-0000WL-4v
for email@domain.net; Sun, 25 Jun 2006 03:43:02 -0400
To: email@domain.net
Subject: New User at Outdoor Digital Photo Online - Digital Photography of the Great Outdoors at Outdoor Photo Net
From: "Outdoor Digital Photo Online - Digital Photography of the Great Outdoors at Outdoor Photo Net)" <email@domain.net>
Auto-Submitted: auto-generated
Message-ID: <200606250701.3deb9b712603@www.outdoor-photo.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-Mailer: vBulletin Mail via PHP
Date: Sun, 25 Jun 2006 03:43:02 -0400

I replaced the actual email addresses with email@domain.net.

What I would like to achieve is that the From: line reads "Outdoor Photo Net" <email@domain.net>

rogersnm
06-25-2006, 05:49 PM
Then change your board name.

64North
06-25-2006, 06:18 PM
LOL
That's my whole point, I don't want to change the board name just to change the "FROM" line of the email, furthermore, I shouldn't have to.

The board name is what it is due to SEO considerations.
Clearly there must be code somewhere that determines what the FROM line of emails is supposed to be, whether that is part of a template or part of the actual vB code.

What I would like to find out where in the code there is a line that looks like
(pseudo) FROM = $vboptions[bbtitle], so that I can hardcode a different name in there.

Edit:
I looked at this myself, turns out that the relevant file is /includes/class_mail.php, will report back once I figured out how to change it. I found it by searching for "from" in all files and looking through those that look like they may have something to do with email.

Edit2: (automerge sucks, as this post is not flagged as new, even though there is now massivly new content :( )
Ok, in /includes/class_mail.php

FIND:

$mailfromname = construct_phrase($this->fetch_first_line($vbphrase['x_mailer']), $vbulletin->options['bbtitle']);

REPLACE WITH:

$mailfromname = construct_phrase($this->fetch_first_line($vbphrase['x_mailer']), "Outdoor Photo Forum");


FIND:

$mailfromname = $vbulletin->options['bbtitle'];

REPLACE WITH:

$mailfromname = "Outdoor Photo Forum";


FIND:

$mailfromname = "$username @ " . $vbulletin->options['bbtitle'];

REPLACE WITH:

$mailfromname = "$username @ " . "Outdoor Photo Forum";


This will result your email header to change from:

Return-path: <email@domain.net>
Envelope-to: email@domain.net
Delivery-date: Mon, 26 Jun 2006 04:14:34 -0400
Received: from xxx by xxx.xxx.xxx with local (Exim 4.52)
id 1FumEs-0003Hm-A1
for email@domain.net; Mon, 26 Jun 2006 04:14:34 -0400
To: email@domain.net
Subject: Welcome to Outdoor Photo Net - Digital Photography and Digital Photo Online Resource!
From: "Outdoor Photo Net - Digital Photography and Digital Photo Online Resource" <email@domain.net>
Auto-Submitted: auto-generated
Message-ID: <200606260816.9a6b42347894@www.outdoor-photo.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-Mailer: vBulletin Mail via PHP
Date: Mon, 26 Jun 2006 04:14:34 -0400


to:

Return-path: <email@domain.net>
Envelope-to: email@domain.net
Delivery-date: Mon, 26 Jun 2006 05:17:01 -0400
Received: from xxx by xxx.xxx.xxx with local (Exim 4.52)
id 1FunDJ-000326-2S
for email@domain.net; Mon, 26 Jun 2006 05:17:01 -0400
To: email@domain.net
Subject: Welcome to Outdoor Photo Net - Digital Photography and Digital Photo Online Resource!
From: "Outdoor Photo Forum" <email@domain.net>
Auto-Submitted: auto-generated
Message-ID: <200606260957.45748e183842@www.outdoor-photo.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-Mailer: vBulletin Mail via PHP
Date: Mon, 26 Jun 2006 05:17:01 -0400


The curious part about the whole thing is that the FROM variable in class_mail.php line:
function start($toemail, $subject, $message, $from = '', $uheaders = '', $username = '')
is supposed to be used to do just that. Meaning if I were to assing a string to $from right in that line of code, it should work, but I couldn't get it to actually work, no matter what I tried.

I am not sure what the problem is. Assigning a variable to $from should eliminate the need to do any of the replace edits I showed above.

I am unable to properly debug the whole thing. This is part of the original class_mail.php code
$from = $this->fetch_first_line($from);
if (empty($from))
{
global $vbphrase;
if (isset($vbphrase['x_mailer']))
{
$mailfromname = construct_phrase($this->fetch_first_line($vbphrase['x_mailer']), $vbulletin->options['bbtitle']);
}
else
{
$mailfromname = $vbulletin->options['bbtitle'];
}

if ($unicode_decode == true)
{
$mailfromname = utf8_encode($mailfromname);
}
$mailfromname = $this->encode_email_header(unhtmlspecialchars($mailfromna me, $unicode_decode), $encoding);

$fromemail = $vbulletin->options['webmasteremail'];
$headers .= "From: $mailfromname <" . $vbulletin->options['webmasteremail'] . '>' . $delimiter;
$headers .= 'Return-Path: ' . $vbulletin->options['webmasteremail'] . $delimiter;
$headers .= 'Auto-Submitted: auto-generated' . $delimiter;
}
else
{
if ($username)
{
$mailfromname = "$username @ " . $vbulletin->options['bbtitle'];
}
else
{
$mailfromname = $from;
}

if ($unicode_decode == true)
{
$mailfromname = utf8_encode($mailfromname);
}
$mailfromname = $this->encode_email_header(unhtmlspecialchars($mailfromna me, $unicode_decode), $encoding);

$fromemail = $from;
$headers .= "From: $mailfromname <$from>" . $delimiter;
$headers .= 'Return-Path: ' . $from . $delimiter;
}
Makes me wonder whether the if (empty($from)) returns TRUE, even if a value is assigned to $from inline.

I just don't know enough about how this all works, but I tried both $from = 'Outdoor Photo Forum' and $from = "Outdoor Photo Forum", and both resulted in empty FROM lines in the email header, empty in such a sense that they looked like this "" <email@domain.net>

Well that's about it. It works the way I chose by replacing all the code as shown above. It would be nice to get it to work by just assigning a value to $from, but after I tried this for a while I grew tried and gave up since I do have a working solution.

Sculli
06-26-2006, 08:34 AM
Edit2: (automerge sucks, as this post is not flagged as new, even though there is now massivly new content :( )
Bump for you.