digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Website and Server Troubleshooting (https://www.digitalfaq.com/forum/web-tech/)
-   -   Add HTML option to vBulletin 3.x "Send Email to Users" admincp (https://www.digitalfaq.com/forum/web-tech/2199-add-html-option.html)

admin 04-28-2010 08:29 AM

Add HTML option to vBulletin 3.x "Send Email to Users" admincp
 
Plain text has its place, but sometimes you need to send HTML email, because it's rich with images, code or links. Newsletters just look nicer when generated as HTML with a good font and layout, as opposed to a cruddy Courier or Times New Roman text-only version email.

For vBulletin 3.5, 3.6, 3.7 and 3.8, you can simply modify the files with some quick code changes, and it will add an HTML option to the "Send Email to Users" admin menu function.

This is all you have to do...

In forumURL/admincp/email.php find:
PHP Code:

print_textarea_row($vbphrase['message_email'], 'message'''1050); 

Add this directly under it:
PHP Code:

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

Again, in forumURL/admincp/email.php find:
PHP Code:

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

Add this directly under it:
PHP Code:

construct_hidden_code('sendhtml'$_POST['sendhtml']); 

In forumURL/includes/class_mail.php locate:
PHP Code:

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

and replace with:
PHP 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;


Note that forumURL is whatever the URL of your site is; i.e. www.mysite.com/forum/ or forum.mysite.com/

And then admincp should be named something else; i.e., adminpanel, and password-protected, for maximum admincp security. If you've renamed it, as you should have done after your installed and secured your vBulletin site, remember to keep this in mind when reading the above instructions.

Similar instructions are found at http://www.vbulletin.org/forum/showthread.php?t=137537

I made these changes through the cpanel/Plesk control panels, as this exact code is not accessible through the admincp's style manager. These are vBulletin core file changes, not style/theme changes.

Not plugin required. In fact, this code change works better than available plugins and mods!

Easy fix. :)


All times are GMT -5. The time now is 12:44 AM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.