vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add-On Releases - Send HTML emails from adminCP (https://vborg.vbsupport.ru/showthread.php?t=137537)

tokenyank 01-25-2007 10:00 PM

Send HTML emails from adminCP
 
Well, this was asked for by many people (me included :) ) without ever being done so things are never done for those who want but not prepared to do for themselves! Thus, a hack is borne!

This hack does what it says on the label. Having come from IPB to vB, I was surprised to see that a default "Send HTML email" from the adminCP was lacking as I used it in my IPB board for newsletters and such. This hack adds the ability to use the default email template that sends plaintext emails or, but toggling the radiobutton, will send HTML mime emails.


Unfortanatly, I am not familiar enough with vB's hooks/plugins so 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;
}


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

**Tested and works for vB versions 3.5.0 to present (3.7.1PL)**

ep13 01-26-2007 12:25 AM

Thick moment here but does this allow it to send a image so the image is seen when email opened. like u get in alienware email for example. if so just what i need :D

Distance 01-26-2007 05:35 AM

File edits

EEK

FleaBag 01-26-2007 09:01 AM

I was actually looking at your 3.5 hack yesterday! Thanks for the update.

COBRAws 01-26-2007 02:25 PM

Quote:

Originally Posted by ep13 (Post 1167393)
Thick moment here but does this allow it to send a image so the image is seen when email opened. like u get in alienware email for example. if so just what i need :D

You cas always add an img tag to your template. Placing the image file in your server. But viewers wont be able to see the image if they open the email offline.

ep13 01-26-2007 02:41 PM

Quote:

Originally Posted by COBRAws (Post 1167772)
You cas always add an img tag to your template. Placing the image file in your server. But viewers wont be able to see the image if they open the email offline.

Can u PM me with how to do that please?

tokenyank 01-26-2007 06:51 PM

Quote:

Originally Posted by ep13 (Post 1167393)
Thick moment here but does this allow it to send a image so the image is seen when email opened. like u get in alienware email for example. if so just what i need :D

This works as if you are coding a HTML page that you'd have on your server but instead of using relative tags, you have to use absolutes...

So, you'd have your email:

Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah

Then you want an image, you'd do it just like a webpage:
<img src="http://www.domain.com/image.jpg">

Then, when the emails are opened *WITH* a HTML ready email client, you have a pretty email!

Quote:

Originally Posted by Distance (Post 1167548)
File edits

EEK

Hey, I was lucky enough to figure out how to do this as it was with almost 0 coding ability... You don't want to edit files, release a plugin and I'll install it too! ;)

Quote:

Originally Posted by FleaBag (Post 1167619)
I was actually looking at your 3.5 hack yesterday! Thanks for the update.

No problem, but this isn't really an update as nothing has changed since release v1... Just added it here for those who limit their searching to 3.6 addon's! :D

bchertov 01-27-2007 05:34 AM

I hope this isn't bad form, but when I saw that this mod required file edits :eek: , I posted a handy little pluggin that automatically sends out any message with HTML in the body text as an HTML email, including from the ACP! :) Check it out here.

I thought I'd give you folks a heads up! :D

timrox 02-23-2007 06:43 AM

I second bchertov's hack. Elegant and simple to install.

Evil Chris 03-16-2007 01:33 AM

I installed with the file edits as I had done in a previous ver of VB.

Thank you.


All times are GMT. The time now is 11:34 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.01034 seconds
  • Memory Usage 1,739KB
  • 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
  • (6)bbcode_code_printable
  • (5)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
  • (10)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