PDA

View Full Version : Mini Mods - Send emails with HTML as HTML


bchertov
12-28-2009, 10:00 PM
Hi Folks,

Here's a nice little pluggin (No Code changes!) my programmer (Bryan Harris) came up with that sets the email type as HTML if the body of an email contains any HTML.

This is just a copy of the original 3.6 mod (165 installs!) - it works fine under 4.0 too! (See testimonials for earlier mods in the Similar Mod links below.)

This is very powerful and flexible, but also a bit dangerous. This means that any email your system sends out that contains any HTML will be sent as HTML. Which means that the whole email should be formatted as HTML.

So for instance, it makes it very easy to send HTML emails from the ACP - Just include HTML in your message! Same goes for users sending private email.

You'll also need to update some of the stock phrases for the registration confirmation email, password change, etc, that contain links or other HTML, and add line breaks <br /> so they still format correctly. And while you're in there you could add your logo and other nice touches!

It's just one pluggin!

Install time: a few seconds!

And I'd appreciate it if you clicked Install if you use it, and while your at it, nominate it for MOTM!

bollie
12-29-2009, 05:07 AM
pluggin ??:eek: No Files Uploaded.

bchertov
12-29-2009, 05:12 AM
pluggin ??:eek: No Files Uploaded.
Picky, picky.... :)

Uploaded!
Thanks!
B

skariko
12-29-2009, 07:02 AM
That's awesome.
Installed!

Alecsmith
12-29-2009, 08:48 AM
Many many thanks :)

TheSupportForum
12-29-2009, 09:25 AM
plugin would be great but as a modder i think that knowing that there is an issue with the line breaks etc.. you should code the changes in your product to fix this please

i would love to use it but not until the minor issue with registration emails are also fixed for this mod

Adem GEN?
12-29-2009, 10:36 AM
Very nice plugin
Thanks
Installed

Adem GEN?
12-29-2009, 10:46 AM
Contact Us Excluding possible?

bchertov
12-29-2009, 02:26 PM
plugin would be great but as a modder i think that knowing that there is an issue with the line breaks etc.. you should code the changes in your product to fix this please

i would love to use it but not until the minor issue with registration emails are also fixed for this mod

The place to fix the line breaks and registration emails is in the phrase that defines it, so that it is entirely plain text or entirely HTML. Any proper HTML tags will trigger the whole email to be formatted as HTML which will ignore carriage returns, etc.

willy888
12-29-2009, 02:43 PM
Great mod
Thanks man

bchertov
12-29-2009, 04:29 PM
Contact Us Excluding possible?
As long as the contactus phrase doesn't have any html tags in it, it should be sent as plain text.

Dr.osamA
12-30-2009, 01:21 PM
thanx man

installed
________
Jeep grand cherokee specifications (http://www.dodge-wiki.com/wiki/Jeep_Grand_Cherokee)

Sworm
01-02-2010, 07:12 PM
Great

cory_booth
01-07-2010, 11:18 AM
Version here says 1.00
Version installed says .9

bchertov
01-07-2010, 07:30 PM
Version here says 1.00
Version installed says .9

I don't think there was a change, but you might want to "upgrade" if you are concerned.

t?rkg?rc?
01-09-2010, 10:06 PM
Thanks

Mind11
01-10-2010, 09:05 AM
Great plugin mate ... thanks!

Installed

bchertov
01-13-2010, 04:46 PM
I got a notification of post by Roy, but I'm not seeing it on this thread. Did you resolve your problem, Roy?

Barry

ahmedipa
01-23-2010, 03:17 PM
good thank you

thmaureira
03-29-2010, 02:28 PM
excelent, just what we need ;)

Verionia
04-07-2010, 09:16 PM
How do you configure in options?

wynode
04-22-2010, 11:09 AM
Nice addition.

Is there anyway to get this to work ONLY when you want to manually send emails to users.

Admincp -> Users -> Send emails to users

bchertov
04-23-2010, 06:08 PM
Nice addition.

Is there anyway to get this to work ONLY when you want to manually send emails to users.

Admincp -> Users -> Send emails to users

That's a decent idea and it's probably doable, but I'm not going to do it now. Remember, this mod is only activated if there is HTML in your email, so most/all standard emails will sent as plain text unless you have added HTML to the phrase.

wynode
04-26-2010, 05:53 AM
OK cheers!

Xencored
05-06-2010, 01:21 PM
<3 works great

elrafei
06-18-2010, 01:25 AM
many thanks

strudinox
06-19-2010, 06:41 PM
Been waiting for this!

Thank you!

Manoel J?nior
07-12-2010, 03:02 PM
Very thanks

KURTZ
07-12-2010, 03:09 PM
You'll also need to update some of the stock phrases for the registration confirmation email, password change, etc, that contain links or other HTML, and add line breaks <br /> so they still format correctly. And while you're in there you could add your logo and other nice touches!

what you mean with this? maybe that we can send a HTML mails for the new registrations? can you give me the phrase that we need to change?

thanks

mrkredo
08-06-2010, 06:23 PM
Installed! Great mod, thanks!

TMSBrad
09-07-2010, 02:11 PM
Could this mod be causing this error: https://vborg.vbsupport.ru/showthread.php?t=249918

My users are getting blank emails with no subject and no body, and they seem to coincide with topic update notifications.

bchertov
09-07-2010, 02:30 PM
Could this mod be causing this error: https://vborg.vbsupport.ru/showthread.php?t=249918

My users are getting blank emails with no subject and no body, and they seem to coincide with topic update notifications.
I don't know. It doesn't seem like is should be causing an error. Anybody else on this thread experiencing this?

I have been receiving occasional blank email to our contact us email address. I have not had any reports of users getting blank emails.

TMSBrad
09-07-2010, 08:00 PM
It's probably the HTML I've entered, but something is definitely not working on the topic update HTML emails.

GeorgeB85
09-08-2010, 12:59 PM
Installed. Works great! Been looking for a way to show off the bold html code with my registration mod!

ravencr
10-06-2010, 12:28 AM
Is there a way to make this work with the welcome email, by chance? Or is there a mod out there that does this, because right now it's only plain text which is annoying.

Chris

bchertov
10-06-2010, 12:37 AM
Is there a way to make this work with the welcome email, by chance? Or is there a mod out there that does this, because right now it's only plain text which is annoying.

Chris

Have you entered HTML tags in the welcome email phrase? It should work...In fact it DOES work for me!

ravencr
10-06-2010, 12:42 AM
Do I just put it at the beginning and the end, and I'm good to go?

Chris

bchertov
10-06-2010, 12:51 AM
Do I just put it at the beginning and the end, and I'm good to go?

Chris

The whole phase text for the email needs to be properly formatted HTML including use BR tags for all line breaks.

Devanand
12-02-2010, 03:00 AM
This is very powerful and flexible, but also a bit dangerous

Why dangerous?

Manoel J?nior
02-20-2011, 09:37 AM
Thanks!!

Tagged more five stars

elrafei
04-06-2011, 06:08 PM
Great mod

thanks

Sharkyman
06-25-2011, 03:38 PM
Very good. Thanks.

aldamon
07-28-2011, 03:56 PM
Nice addition.

Is there anyway to get this to work ONLY when you want to manually send emails to users.

Admincp -> Users -> Send emails to users

That's a decent idea and it's probably doable, but I'm not going to do it now. Remember, this mod is only activated if there is HTML in your email, so most/all standard emails will sent as plain text unless you have added HTML to the phrase.

Any progress with this idea? Right now I'm activating/deactivating the plugin when I need to send an Email and when I'm done.

bchertov
07-28-2011, 04:48 PM
Any progress with this idea?Nope, sorry.

walter_ps2
07-30-2011, 08:59 AM
It doesn't work on 4.1.3

bchertov
07-30-2011, 10:35 PM
I haven't installed 4.1.3 yet, sorry. Can anybody confirm or deny that there is problem with this hack on 4.1.3? I'd be surprised if there's a problem.

cavyspirit
08-20-2011, 06:45 PM
I haven't installed 4.1.3 yet, sorry. Can anybody confirm or deny that there is problem with this hack on 4.1.3? I'd be surprised if there's a problem.

Dang. I'm wanting to try it on my 4.1.4 soon to be 4.1.5 forum. But would like to know if it works first.

aldamon
08-31-2011, 02:38 PM
We sent a newsletter out yesterday with 4.1.5 PL1 and it worked fine.

duditas
12-24-2011, 05:57 PM
vB 4.1.8 and still working. Great mod. Thanks!!

deverill2010
02-29-2012, 12:37 PM
Does anyone have a complete list of which stock phrases need to be updated for this?

chapsrulez
03-05-2012, 06:11 AM
great plugin.
thanks!

mpoorrajab
04-05-2012, 11:17 AM
Hi
How can I test forum emails? (Subscription, Activating, Greeting and ...)
Thank you

DuraMater
04-06-2012, 10:39 AM
I am very new to all of this, just purchased vBulletin 4.1.11 Patch Level 1 a week ago. How do I install this plugin? Do I just upload the .xml file from my computer using the ACP? Or do I have to physically add it as a new plugin? If so, what would be the hook location in the code? What would be the execution order? Forgive my ignorance, I know some html, a very small amount of css, and nothing about php at all. Thanks in advance!

P.S. - Nevermind. Plugin downloaded, installed, and tested. Worked perfectly! Thank you, bchertov, for this wonderful code!

mpoorrajab
04-07-2012, 06:50 PM
I have a problem.
In emails which contain text from forum like PM mails, all lines are merged. Because this type of text isn't HTML.
Is there any way too solve this problem?

Cybex
05-12-2012, 07:54 AM
Looks great so far, thanks!

trigatch4
06-06-2012, 05:08 PM
For those complaining it alters other e-mails negatively... why not activate it when sending an e-mail and then unactivate/delete? Easy enough. Unless I'm missing something?

Sworm
06-07-2012, 12:52 PM
working on 4.2.0?

adwolf1
06-24-2012, 02:14 PM
working on 4.2.0?

it appears to be here.

I wonder if anyone has come up with a solution to the problem of e-mails that get the text all running together, like "new post notifications".

There must be some way to alter the phrases in a template and turn them from text -> html before they are output.

anyone here have an idea of how to get that done? otherwise this is a great mod

bchertov
06-24-2012, 08:07 PM
it appears to be here.

I wonder if anyone has come up with a solution to the problem of e-mails that get the text all running together, like "new post notifications".

There must be some way to alter the phrases in a template and turn them from text -> html before they are output.

anyone here have an idea of how to get that done? otherwise this is a great modYou need to edit those phrases to substitute html breaks < br/ > for the carriage returns.

JamesUK
07-24-2012, 08:43 AM
since installing this I have been trying to add images and links to the emails sent by the forum.. im testing using the 'diagnose' email..

No matter what i try to add.. every URL is stripped fom the email when its sent and obviously links dont work with no href declarations, <img> has no src declarations etc..

how do i get past this??

All i am trying to do is add an image to all emails sent by the forum butfor such a simple task this is proving surprisingly hard!

bchertov
07-24-2012, 07:58 PM
since installing this I have been trying to add images and links to the emails sent by the forum.. im testing using the 'diagnose' email..

No matter what i try to add.. every URL is stripped fom the email when its sent and obviously links dont work with no href declarations, <img> has no src declarations etc..

how do i get past this??

All i am trying to do is add an image to all emails sent by the forum butfor such a simple task this is proving surprisingly hard!

I haven't tried this but what I can tell you is that this all this plugin does is change the header on your email to say it is html. So I suspect something else may be changing the contents. Sorry.

thebucky84
09-17-2012, 03:16 AM
works perfect! Love it and thanks!!

artcrimes
10-17-2012, 11:13 AM
don't work. 4.2.0

David Copeland
11-20-2012, 06:59 AM
don't work. 4.2.0

That's too bad.

Anyone else have a fix?

David Copeland
11-28-2012, 09:21 PM
That's too bad.

Anyone else have a fix?

Bump

bchertov
12-02-2012, 06:07 PM
I don't have 4.2 installed, but I'd be surprised if this doesn't work on 4.2. Has anybody tried it on 4.2 besides artcrimes?

khoking
02-07-2013, 03:06 PM
I don't have 4.2 installed, but I'd be surprised if this doesn't work on 4.2. Has anybody tried it on 4.2 besides artcrimes?

I am using 4.2.0, doesn't work.

After I uninstalled, all emails I tried to send via Send Email to User don't go out now. No error, but users just don't get any emails... :(

Dragon Company
03-10-2013, 06:44 PM
It will be great if it could work with 4.2.0 ... So nice hack

bchertov
03-10-2013, 07:34 PM
I am using 4.2.0, doesn't work.

Thanks for the validation.

After I uninstalled, all emails I tried to send via Send Email to User don't go out now. No error, but users just don't get any emails... :(

If its truly un-installed then its not this hack that is causing your problem. I suspect it's a spam filter.

bchertov
03-10-2013, 07:36 PM
It will be great if it could work with 4.2.0 ... So nice hack

I release this hack into the public domain. Anybody is welcome to send me a fix and I'll update it or release a new hack based on this - but please give me credit for original design.

lcn
03-12-2013, 03:13 PM
Can anyone confirm that this works with 4.2.0 ?

Dragon Company
03-27-2013, 06:39 PM
I release this hack into the public domain. Anybody is welcome to send me a fix and I'll update it or release a new hack based on this - but please give me credit for original design.
But Im' more a designer than a coder, so I won't be usefull.
Anyway it works perfectly on my 4.2.0. Problem was my server with too agressive cache.

Thanks again for all what you've done

bchertov
03-27-2013, 06:46 PM
But Im' more a designer than a coder, so I won't be usefull.
Anyway it works perfectly on my 4.2.0. Problem was my server with too agressive cache.

Thanks again for all what you've done

Thanks for letting me know Dragon!

This is a risk you take with this hack - I'm guess HTML email are more likely to marked as spam. So if you are not recieving the emails that this hack sends out, please check your spam filters.

khoking (and anybody else using 4.2) can you plesae chime in if infact this hack will work with 4.2? Again, if the emails get trapped by a spam filter, it doesn't mean that this hack doesn't work!

Nonowmana
03-27-2013, 11:42 PM
for version 4.2

First step:

In admincp/email.php Find:
print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50);

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

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

add just below

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

step 2

in includes/class_mail.php Find:

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

replaced by:

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

source: http://www.vbulletin-ressources.com/forum/threads/19514-Mail-en-html?p=141032#post141032

synseal
06-07-2013, 03:22 PM
Thanks for letting me know Dragon!

This is a risk you take with this hack - I'm guess HTML email are more likely to marked as spam. So if you are not recieving the emails that this hack sends out, please check your spam filters.

khoking (and anybody else using 4.2) can you plesae chime in if infact this hack will work with 4.2? Again, if the emails get trapped by a spam filter, it doesn't mean that this hack doesn't work!

This appears to be working fine for me after testing using vb 4.2.0 pl3 with vbseo.

craigvm
11-12-2013, 07:27 PM
this mod is working fine for me on vb 4.2.2

stevieb
02-17-2014, 10:59 AM
for version 4.2

First step:

In admincp/email.php Find:
print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50);

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

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

add just below

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

step 2

in includes/class_mail.php Find:

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

replaced by:

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

source: http://www.vbulletin-ressources.com/forum/threads/19514-Mail-en-html?p=141032#post141032Hi, thanks for this - will test it shortly..... :)

stevieb
09-13-2014, 12:31 PM
for version 4.2

First step:

In admincp/email.php Find:
print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50);

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

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

add just below

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

step 2

in includes/class_mail.php Find:

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

replaced by:

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

source: http://www.vbulletin-ressources.com/forum/threads/19514-Mail-en-html?p=141032#post141032

Hi

Do you do this after installing the mod or do we just do this and not upload the mod? Specifically for vB 4.2

Art Andrews
09-18-2014, 12:14 AM
This is a great mod, but one of the issues we are having is that all of the text in a notification, especially if there is a quote involved, is one large block with no coding applied. Is there any way to change this so actually content of the email is formated as well?

stevieb
10-08-2014, 04:57 PM
This is a great mod, but one of the issues we are having is that all of the text in a notification, especially if there is a quote involved, is one large block with no coding applied. Is there any way to change this so actually content of the email is formated as well?I added divs (HTML) wrapped around the $text (or $message) and that formats the PM alert to an extent. A multi quote gets messy.

However I've since removed the actual PM text and instead added a login link so our users must visit the forum to view PM's.

Art Andrews
10-16-2014, 06:48 PM
I added divs (HTML) wrapped around the $text (or $message) and that formats the PM alert to an extent. A multi quote gets messy.

Did you apply anything to the divs? I added divs and that didn't seem to do anything at all to the formating of quotes within $plaintext_message which is the content of the message that gets sent out.

webmaster74
01-04-2015, 09:41 PM
thank you very much for such an amazing modification.
vBulletin, with its pure text notifications is still in the 1980's. Thank you for bringing vB to 2015!

grey_goose
01-04-2017, 03:54 AM
Is there some reason to not just add:


$message = nl2br($message);


To address the line breaks?

bchertov
01-04-2017, 10:55 PM
Is there some reason to not just add:


$message = nl2br($message);


To address the line breaks?

Sounds like a fine idea! :up:

Raptor
08-10-2017, 07:24 AM
plugin works just fine with vb 4.2.3 but without line breaks.

is there any update to solve that?

Seven Skins
08-10-2017, 04:25 PM
^ Read 2 posts above your post, that will take care of line breaks.

Stratis
01-01-2018, 06:25 PM
I will try to use this plugin but where this code suppose to go?
$message = nl2br($message);

Thanks

gnrx
12-04-2018, 12:39 PM
I'm interested in install this mod, I have vb 4.2.5 and PHP 7.1, I don't know if work with this version, I can try...
But before install and made all changes, its possible send html mail from admincp with "From"? I'm explained:
Now, when send mail to users from admincp, the from when the users received the mails are: mail@mydomain.com <mail@mydomain.com>
Its possible edit this for the Name Of the Site ?

Thanks in advance!

Paolitus
02-02-2019, 11:23 AM
work on vB 4.2.5
Thank you

bienenf
01-25-2020, 12:07 PM
work on vB 4.2.5
Thank you

Hello @Paolitus,

Have you this mod works on VB 4.2.5 with the html format properly, and break lines ?

If yes, is that possible to share the modification ?

Thank you in advance
Yves