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.

giovannicosta 03-17-2007 05:09 PM

Is it wysiwyg editory like?

ThunderWolf 04-01-2007 07:37 AM

Dear tokenyank,
I try it in VB 3.6.5 and worked very well, Thank you so much.
Regards,
ThunderWolf

markblair 04-12-2007 03:05 AM

Works great, thanks! :)
vBulletin 3.6.4

coffee 04-24-2007 10:31 AM

Quote:

Originally Posted by tokenyank (Post 1167957)
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! ;)

< Seconds that! as we can only wait for vBulletin team to add this letting people to send HTML formated messages

Thank you Tokenyank.

Demo16 06-01-2007 09:07 AM

Wow! Great add on I just installed! There's a way to add extra emails also to send it to people not subscribed to the forum??

Demo16 06-02-2007 11:32 AM

And there's a way to send php emails?

tokenyank 06-20-2007 03:08 PM

No because php is a server side language which means any php embedded into an email would only parse IF the enduser had LAMP on their machine and would accept random php from executing from Outlook!

GreysAnatomy 06-26-2007 11:04 AM

I have just installed this on my forum and it's working great, thank you! I've waited so long for such a hack and you made my dream come true. This is the first HTML email hack that I had absolutely no problems installing - ind it only took me like 2 minutes as well. You're a hero!

Head Roller 08-13-2007 06:23 PM

fantastic... thanks

alfieuk 09-21-2007 11:43 AM

Quote:

Originally Posted by GreysAnatomy (Post 1276841)
I have just installed this on my forum and it's working great, thank you! I've waited so long for such a hack and you made my dream come true. This is the first HTML email hack that I had absolutely no problems installing - ind it only took me like 2 minutes as well. You're a hero!


I absolutely agree. :D

I am going to use this alot :p

Clicked Installed

hector2000 10-04-2007 05:49 PM

it dont work!
i think there is problem in this code:

Code:

print_yes_no_row('Send HTML Email?', 'sendhtml', 0);
this code seem to ask a question.!send html email?
i changed this code and problem solved:
Code:

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

i change plain to html and it work.
what is that question?
how may i answer that?
thx

hector2000 10-08-2007 09:28 AM

No Answer?!

layxtuzen 10-29-2007 09:10 AM

does this work on vb 3.6.8 ?

RS_Jelle 11-02-2007 12:11 PM

Quote:

Originally Posted by layxtuzen (Post 1370994)
does this work on vb 3.6.8 ?

Yes, it does ;)

ludachris 11-12-2007 09:00 PM

So I tested it and received the email that contained a big paragraph of text (presumable the text version of my html email, only it was all one big paragraph) and then the html newsletter showed up underneath all the text. What happened? I'm using 3.6.8.

ludachris 11-12-2007 09:27 PM

I've tried changing from PHP to SMTP and get the same results. Is this due to an Outlook setting maybe?

Alfa1 12-09-2007 02:53 PM

Can you see a preview of the email you have made?

Tom_S 12-09-2007 11:23 PM

Quote:

Originally Posted by bchertov (Post 1168193)
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

I use the above hack. It does have a draw back. Unless you edit all your files that vb sends out converting them to html ie new member registration keys, reminders, etc. it will cram all the text up. I personally use it to send out our newsletter and then uninstall it when I am done. Takes a couple of minutes and I like the outcome very much. No editing.

Flep 12-16-2007 07:41 AM

It works great !
3.6.7

thank you !

Sworm 03-02-2008 06:07 PM

tokenyank, it work very well for me :)

Thanx :)

Tom_S 03-03-2008 01:36 AM

I went ahead and installed that today. I was bored. It works great! I just don't like editing the php files. It sucks when the vB updates come out because my old brain forgets what I have to go and edit. LOL

len backus 03-03-2008 04:29 PM

Is it possible to send both plain text and html email versions?

veenuisthebest 05-07-2008 04:29 PM

this working perfect on my 3.7.0 Gold !!

i hope vB team soon gets this feature inbuilt with nice extra features !!

thanks a lot ..

Pvtiste 05-15-2008 12:35 PM

Does it work with vb 3.6.10 ?

bchertov 05-16-2008 05:00 AM

Quote:

Originally Posted by Pvtiste (Post 1520429)
Does it work with vb 3.6.10 ?

I don't know, but I've got to imagine that it does. I wouldn't worry about it. If it doesn't I'll fix it for you right away!

sdfaheem 05-16-2008 10:39 PM

Could anyone show me a demo of the newsletter?
Can we set duration to send the newsletter, like weekly or monthly?

tokenyank 05-17-2008 01:39 AM

Quote:

Originally Posted by Tom_S (Post 1455595)
I went ahead and installed that today. I was bored. It works great! I just don't like editing the php files. It sucks when the vB updates come out because my old brain forgets what I have to go and edit. LOL

I know, that's what I use the 'notes' section for in the admin panel.. Anything I need to do code editing, I put the name of the hack, the url for it here, and what files I had to edit. My personal post-it note
Quote:

Originally Posted by len backus (Post 1456058)
Is it possible to send both plain text and html email versions?

Yes, there is a toggle that you can send either txt or html, but not both at same time
Quote:

Originally Posted by Pvtiste (Post 1520429)
Does it work with vb 3.6.10 ?

Yes
Quote:

Originally Posted by sdfaheem (Post 1522110)
Could anyone show me a demo of the newsletter?
Can we set duration to send the newsletter, like weekly or monthly?

There is no demo... You create your newsletter in your favourite html editor, upload all the css/images to your site, **MAKE SURE YOUR IMAGES AND CSS** are coded to use absolute paths, you then copy all the HTML from the editor and paste it into the box in the admincp and toggle HTML and hit send... Badda bing.

As to scheduling, no, there's no way to add scheduling to this... If you want something that robust, you'll need to use Sendstudio or OemPro or similar.

bchertov 05-17-2008 03:47 PM

Quote:

Originally Posted by len backus (Post 1456058)
Is it possible to send both plain text and html email versions?

You can send a plain text email as long as your messages doesn't have any HTML tags in it. If an HTML tag is found it is sent out as HTML, otherwise it is sent as plain text.

tokenyank 05-18-2008 12:03 PM

Some things work like that, yes bchertov... My particular hack isn't that smart.

There is a toggle that you have to explicitly say whether the email is to be sent via plaintext or HTML.

If you put HTML in the editor box and hit send without toggling the HTML option, the email will be sent out plaintext.

As I said before, I'm not clever enough to make this as good as it could be or do it without code edits... This suits my needs and thus I put it here to hopefully help someone else..

bchertov 05-19-2008 04:47 AM

Quote:

Originally Posted by bchertov (Post 1522692)
You can send a plain text email as long as your messages doesn't have any HTML tags in it. If an HTML tag is found it is sent out as HTML, otherwise it is sent as plain text.

Quote:

Originally Posted by tokenyank (Post 1523435)
Some things work like that, yes bchertov... My particular hack isn't that smart...

My apologies. I thought this was a question from the hack I published thread.
B


All times are GMT. The time now is 04:22 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.01673 seconds
  • Memory Usage 1,828KB
  • 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
  • (8)bbcode_code_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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