vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Send HTML emails from adminCP (https://vborg.vbsupport.ru/showthread.php?t=99910)

tokenyank 11-01-2005 10:00 PM

Send HTML emails from adminCP
 
***3.6.x version of hack here***

Well, this was asked for by many people (me included :) ) without ever being done so I recruited some of my more knowledgable friends in php to get the syntax right for the following hack.

It is done with 2 file edits but I'm sure that it could be done with a plugin if someone ever feels the need...


Step 1:
In admincp/email.php find:

Code:

print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50);
Directly below it place:
Code:

print_yes_no_row('Send HTML Email?', 'sendhtml', 0);
Step 2:
In admincp/email.php find:

Code:

construct_hidden_code('test', $vbulletin->GPC['test']);
Directly below it place:
Code:

construct_hidden_code('sendhtml', $_POST['sendhtml']);
Step 3:
In includes/class_mail.php find:
Code:

$headers .= 'Content-Type: text/plain' . iif($encoding, "; charset=\"$encoding\"") . $delimiter;
and replace with:
Code:

if($_POST['sendhtml'])  {
  $headers .= 'Content-Type: text/html' . iif($encoding, "; charset=\"$encoding\"") . $delimiter;
}else{
  $headers .= 'Content-Type: text/plain' . iif($encoding, "; charset=\"$encoding\"") . $delimiter;
}

Special thanks goes to non vB users Darryn, Pink, DO, and Dang for the helping me with syntax and pointing me in the right direction to get this done.

(you may modify this hack at will... No permission needs to be granted)

EDIT:
Just installed on 3.5.1 and still works with no problem... Just changing the vB version
EDIT2:
Just installed on 3.5.2 and still works with no problem... Just changing the vB version
EDIT3:
Just installed on 3.5.3 and still works with no problem... Just changing the vB version
EDIT4:
Works for 3.5.4

RS_Jelle 11-02-2005 04:17 PM

Thanks, I really needed this :up:

[high]* RS_Jelle clicks install :)[/high]

FleaBag 11-02-2005 06:15 PM

Thats wicked. Do you know of a guide to writing HTML e-mails I can reference?

Ryan McBain 11-02-2005 07:22 PM

This is great. Can anyone turn this into a plugin please?

Ghanem 11-02-2005 09:22 PM

thank you very very much

phonexpo 11-06-2005 03:53 PM

Installed, thanks been looking for this for ages - well done.....

OsMoSiS.it 11-09-2005 11:56 AM

More "vBulletin style" coded (hardened security by using $vbulletin->GPC) version of the same modification :)


In admincp/email.php find (line 62):
Code:

                'message'          => TYPE_STR,
After add:
Code:

                'sendhtml'          => TYPE_BOOL,

Find (line 253):
Code:

        construct_hidden_code('perpage', $vbulletin->GPC['perpage']);
After add:
Code:

        construct_hidden_code('sendhtml', $vbulletin->GPC['sendhtml']);

Find (line 286)
Code:

                print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50);
After add:
Code:

                print_yes_no_row('Send HTML Email?', 'sendhtml', 0);

In includes/class_mail.php find (line 249):
Code:

                $headers .= 'Content-Type: text/plain' . iif($encoding, "; charset=\"$encoding\"") . $delimiter;
replace with:
Code:

                if ($vbulletin->GPC['sendhtml'])
                {
                        $headers .= 'Content-Type: text/html' . iif($encoding, "; charset=\"$encoding\"") . $delimiter;
                }
                else
                {
                        $headers .= 'Content-Type: text/plain' . iif($encoding, "; charset=\"$encoding\"") . $delimiter;
                }


Ryan McBain 11-12-2005 08:14 AM

I had lots of problems with this hack so I had to uninstall. When I post new threads on my board I had problems. I would get errors. If I posted an image in the thread I would good an error coming from the includes/class_mail on line 249.

And even if post a regular post, I my page would get stuck. The posts would still go on put I would get these errors.

tokenyank 11-13-2005 03:56 PM

You must have had a typo or missed out a character or something in the install as I've been running it since I posted the code here and haven't had a problem at all...

I do have to say that I'm confused to why you'd get errors in class_mail if you post an image! Try from fresh files and make sure you don't delete a ; or ' accidentally...

(this assumes you tried mine and not OsMoSiS.it's code edit as I have no idea what he did and the possible ramifications of a typo! :D )

hoangminh 11-18-2005 09:00 AM

Quote:

Originally Posted by tokenyank
You must have had a typo or missed out a character or something in the install as I've been running it since I posted the code here and haven't had a problem at all...

I do have to say that I'm confused to why you'd get errors in class_mail if you post an image! Try from fresh files and make sure you don't delete a ; or ' accidentally...

(this assumes you tried mine and not OsMoSiS.it's code edit as I have no idea what he did and the possible ramifications of a typo! :D )

Yeah, I think that Ryan McBain has modified other class than mail, if you post image or any other, I think the class_mail can not be used

Thanks for greate hack. Installed. I need it for long time.

She Unlimited 11-18-2005 09:26 AM

Sorry, how can I find the send email.php template...

:nervous:

hoangminh 11-18-2005 09:46 AM

Quote:

Originally Posted by She Unlimited
Sorry, how can I find the send email.php template...

:nervous:

not template, edit files, it's admincp/email.php

Read carefuly before you start your work.

FleaBag 11-18-2005 01:01 PM

OsMoSiS.it, what does your more secure version protect against?

She Unlimited 11-18-2005 01:08 PM

I have never edit files before, but if you could give me a pointer...sorry.... :nervous: :o

FleaBag 11-18-2005 01:20 PM

You'll need a file editor. Try EditPlus. The majority of file editing is copying and pasting, with a bit of searching. Just use the search and search/replace in EditPlus. I'm assuming you can FTP files if you have vB installed. :)

fabianv 11-27-2005 02:15 PM

Thank you for this.

She Unlimited 11-27-2005 10:41 PM

Quote:

Originally Posted by FleaBag
You'll need a file editor. Try EditPlus. The majority of file editing is copying and pasting, with a bit of searching. Just use the search and search/replace in EditPlus. I'm assuming you can FTP files if you have vB installed. :)


LOL...yes thank you.... :nervous:

KevNJ 12-02-2005 01:49 AM

::clicks installs ::

INSTALLED!!!

Works PERFECTLY!!!!!

I went to send out my first newletters for my site tonight, and after sending some test emails realized sending html emails wasnt an option. So came over here, and found this mod right away. Edited the files like it says. Works like a charm!

Thanks for taking the time to do this!

Awesome!!

Watson 12-08-2005 11:52 AM

Works a Treat. Superb. Love it

Thanks for this

Andreas 12-08-2005 12:23 PM

Step 3 an be done with a Plugin, the other ones could be done (not 100% sure without impementing it) with Plugins too.
And I strongly recommend to use the modified version from this post

tidy_boy 12-13-2005 06:53 AM

excellent hack would be good if plugin was made forit tho to save file edits

mwhoob 12-13-2005 10:22 AM

problem with arabic
im sad

tidy_boy 12-13-2005 02:59 PM

Hi there I did the changes in the first post. Then I sent out a html email and got a db error

Database error in vBulletin 3.5.2:

Invalid SQL:

UPDATE vb3_session
SET lastactivity = 1134492878, location = '/forum/admincp/email.php?do=dosendmail', inforum = 0, inthread = 0, incalendar = 0, badlocation = 0
WHERE sessionhash = 'cb72da628436727c8a87044cb2eb0927';

MySQL Error : Lost connection to MySQL server during query Error Number : 2013
Date : Tuesday, December 13th 2005 @ 05:56:19 PM
Script : http://www.harddanceaddict.net/forum/admincp/email.php
Referrer : http://www.harddanceaddict.net/forum...l.php?do=start
IP Address :
Username : tidy_boy
Classname : vb_database


Any ideas?

silurius 12-13-2005 03:16 PM

Anxious to install but I have so many hacks already I'm going to await the plugin version.

tidy_boy 12-13-2005 03:31 PM

Quote:

Originally Posted by silurius
Anxious to install but I have so many hacks already I'm going to await the plugin version.

Hi there mate the hack works. My html email got sent out but I got this one error

Baitona 12-14-2005 11:39 AM

tokenyank
It is a wonderful hack, working 100%


Quote:

Originally Posted by mwhoob
problem with Arabic
im sad

mwhoob :)
Yes it has a little problem with Arabic, since AJAX features doesn't support Arabic characters.

From now until someone figures out how to let AJAX support Arabic features you need to disable the AJAX inside your forum, then this hack will work 100%

I have tested it my self, and it is a wonderful hack.

Go to:
Vbulletin Option>>>>> General Settings>>>> Disable AJAX Features

Then Choose,
Disable Problematic AJAX Features

Baitona

zendiver 12-14-2005 09:43 PM

Token, awesome...just tested this on 3.5.2 and without even so much as a hick-up so far.

Great job.

phonexpo 12-16-2005 10:15 AM

Quote:

Originally Posted by zendiver
Token, awesome...just tested this on 3.5.2 and without even so much as a hick-up so far.

Great job.

Yeah great hack... I've just reinstalled it on 3.5.2 ... :)

Smiry Kin's 12-23-2005 12:31 AM

3.5.2

works great, even found a simple simple! way to make a newsletter :)

*install

xBhp 12-25-2005 03:08 PM

hi tried installing this on 3.5.2, i couldnt belive but i cant find this line in email.php :

construct_hidden_code('test', $vbulletin->GPC['test']);

whatam i missing!

nor there is the class_mail.pho in includes directory!

phonexpo 01-09-2006 01:00 PM

Working with 3.5.3 :)

The Chief 01-26-2006 05:57 PM

thanks for this cool mod :)

[high]* The Chief clicks install[/high]

Gizmo999 02-02-2006 06:33 PM

Giz clicks "install" thanks for the hack.

One small suggestion or maybe someone can tell me how to add a "receive html newsletter" preference to the user options under their receive admin email selections.

I created it in user profile fields added it to options/messaging notification but now can't see it anywhere :(

Annie^.^ 02-07-2006 01:16 AM

installed and works great

Xzyte 02-21-2006 09:00 PM

Just upgraded my board to 3.5.4 and it still works great with no problems at all. :)

Great work tokenyank! Thanks.

Sjox 03-10-2006 10:55 AM

Hello,

This is what I was looking for.:cool:

It'is working just fine.

Thank you for this hack.

Sjox

Smiry Kin's 03-15-2006 12:22 AM

anywa to make it send n email using the forum skin in away?

masterross 03-19-2006 11:06 PM

any hints how to modify it to send HTML welcome mails too??

thanks,
Ross

Dragon Company 04-24-2006 06:24 PM

Works perfectly !! Thanks a lot !

swantonio 04-28-2006 10:57 AM

perfect Install :-)


All times are GMT. The time now is 04:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03238 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (14)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete