PDA

View Full Version : Add-On Releases - Send HTML emails from adminCP


tokenyank
01-25-2007, 10:00 PM
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:

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

Directly below it place:
print_yes_no_row('Send HTML Email?', 'sendhtml', 0);

Step 2:
In admincp/email.php find:

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

Directly below it place:
construct_hidden_code('sendhtml', $_POST['sendhtml']);

Step 3:
In includes/class_mail.php find:

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

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

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! ;)

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 (https://vborg.vbsupport.ru/showthread.php?t=137593).

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
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
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:

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:
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
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
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 (https://vborg.vbsupport.ru/showthread.php?t=137593).

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
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
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
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
Does it work with vb 3.6.10 ?
Yes
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
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
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.

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 (https://vborg.vbsupport.ru/showthread.php?t=137593) thread.
B

Javierogo
09-04-2008, 11:14 PM
I had this hack in my vBulletin 3.7.2, but 1 hour ago with the 3.7.3 the templates is missing. I changed every templates one more time and it works very well.
https://vborg.vbsupport.ru/external/2011/12/7.gif

TNCclubman
02-16-2009, 01:11 AM
Damn, need this! Does it work with vB 3.8.1?

TNCclubman
02-17-2009, 11:29 PM
Works with the latest vB 3.8.1!

thanks!

mattwmc2001
07-19-2009, 11:06 PM
Sweet, works for 3.83!

Thanks a bunch :)

jskoh
08-24-2009, 12:58 PM
hi, had edited the php file but couldnt see the email html anywhere...

kyrenator
09-16-2009, 07:33 PM
it doesn work for me in vb 3.8.4! I ve done all the steps correct but i see no difference!

skariko
12-28-2009, 12:32 PM
Anyone know how make this on VB4?

I really need this mod. :)

bchertov
12-29-2009, 04:23 AM
Anyone know how make this on VB4?

I really need this mod. :)
I suggest you check on a similar mod I posted here:
https://vborg.vbsupport.ru/showthread.php?t=185310&referrerid=70601

I haven't tested it yet in VB4, but I bet it works! It's really simple!

Barry

bchertov
12-29-2009, 04:41 AM
I suggest you check on a similar mod I posted here:
https://vborg.vbsupport.ru/showthread.php?t=185310&referrerid=70601

I haven't tested it yet in VB4, but I bet it works! It's really simple!

Barry
I just tested it and it worked fine! I've released it for 4.0 here:
https://vborg.vbsupport.ru/showthread.php?p=1941206#post1941206

Elric
02-16-2013, 04:14 AM
Have anywhere a idea for make this working on vb 4.2 ?

The mod for vb 4 have this problem:

https://vborg.vbsupport.ru/showpost.php?p=2404567&postcount=31