vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   HTML Email Feature (https://vborg.vbsupport.ru/showthread.php?t=38199)

Logician 05-02-2002 10:00 PM

HTML Email Feature
 
Hiyas,

What does it do?
With this hack, your board will have "HTML email" feature.

How does it work?
After applying the hack, your users will be able to choose whether they want PLAIN TEXT emails or HTML messages and mails originated from your site will be sent accordingly. (At the moment works for PM and email notification mails). Your existing users who didnt change their mail settings will recieve the original plain texts mails, while users who asked for HTML mails will get mails in HTML format. All users can anytime change their mail settings inside User CP or by calling the new 2 links with one click that comes with the hack and update member's mail type.

What versions of vbulletin does it work with?
Hack tested with version 2.2.2, 2.2.6, 2.2.8 and 2.2.9 but I believe it will work with any versions > 2.0.3.

Any Screenshots?
See the message below

Planned Future Features:
* Hack will apply to ALL mails originated from your board (At the moment it is for PM and email notification mails)
* Your HTML mails may include compiled data from your board such as "Last X message titles", "Recent Titles from the forum you subscribed", "Last X answered/unanswered messages", "user's incoming personal events", "Incoming general events from your calender" and etc.

I plan to work on this hack only if it's considered useful and used by people. After spending a long time to code/debug/test/publish a hack, it's quite disappointing to see that 2 months later only 3-5 people used (installed) a hack. So if you use the hack, please dont forget to click INSTALL for this hack or for any hack you use! ;)

Thank you and Enjoy..\\=^))
Logician

Logician 05-03-2002 06:28 PM

Here is a screenshot for "new reply notification email". It's simply a HTML message so you can use any design you like. It's just a sample I use in my board.

Notice that the screenshot is NOT a webpage! It's the EMAIL your members (who choose to recieve HTML mails) gets. It looks like a webpage because it's in HTML format :) This also clarifies what "HTML email" mean if you dont know the term. In an other words HTML mails are the mails with color/background/images/bold-italic-underlined fonts just like web pages..

John 05-03-2002 06:41 PM

:eek: Is it easy to customise the email?

Logician 05-03-2002 06:52 PM

Quote:

Originally posted by JohnWarwick
:eek: Is it easy to customise the email?
yep.. it's a template in your Admin CP. Simply create your mail in your favorite Web Design enviroment then copy/paste the code into your existing template. Cant be easier..

John 05-03-2002 07:03 PM

I think I'll install this :)

Robouk5 05-03-2002 08:24 PM

This has good potential, I may use this =) Thanks

JulianD 05-03-2002 10:19 PM

Nice, really nice feature :)

mashby 05-05-2002 01:00 PM

You come to my resuce again! I just had a member request that e-mail from our forum come to him in HTML format. What I thought was impossible, you've made possible. I will install this later today for sure.

One quick question though: I'm using the Community Bulletin hack for sending weekly bulletins. Do you know if your hack will send these e-mails as HTML as wel?

Logician 05-05-2002 04:06 PM

Quote:

Originally posted by mashby
One quick question though: I'm using the Community Bulletin hack for sending weekly bulletins. Do you know if your hack will send these e-mails as HTML as wel?
By default no. But this hack adds a new user profile field to database so by querying this field it's possible to adapt this feature any email originated from your site. I dont know the hack you mentioned however the author of the hack may consider making this adaptation if he likes.

Swayed 05-07-2002 01:54 AM

I was about to start writing this one out myself, but you posted this right before I had to, which I'm glad for because I didn't realize before I started how big of a hack this would be. Saved me alot of time.

One thing to note is that the font in the "HTML/Plain Text Emails" option on the Edit Options page is not the same as the rest of the page. This is easily fixed by modifying the modifyoptions, registeradult and registercoppa templates, and replacing
PHP Code:

<b>HTML/Plain Text Emails?</b

with
PHP Code:

<normalfont><b>HTML/Plain Text Emails?</b></normalfont

Something to point out for those who haven't tried it yet, you can personalize the email in the html email templates by including the same php code that is located in the non-html email templates.

Great hack, Logician.

Logician 05-08-2002 06:05 AM

@Swayed: Thx, I updated the file..

JoshFink 06-18-2002 01:52 AM

Is there a way to put a plain text message at the top of the page in case they are in HTML and they can't read the message?

This is what I would like to put, but I don't know how to make it appear in text and not HTML format :

PHP Code:

--------------------------------------------------------------------------- 
The email you are receiving is in HTML format. If you are having 
trouble reading this
it is because your email 
program does not support HTML email


Please follow the below link to change back to text email

--------------------------------------------------------------------------- 

Thanks

Josh

Logician 06-18-2002 08:52 AM

Quote:

Originally posted by JoshFink
Is there a way to put a plain text message at the top of the page in case they are in HTML and they can't read the message?

This is what I would like to put, but I don't know how to make it appear in text and not HTML format :

Josh you can put in just in the begining of the HTML email template before anything else. Then it will be displayed correctly since no HTML command is parsed yet but it would shown awkardly if user uses HTML. So I wouldnt use it.. You better test it, load the message with both HTML ON and OFF and decide if having this text in your mail justifies the bad look in HTML mails.

JoshFink 06-18-2002 12:51 PM

Thanks for the reply..

Do you have any other suggestions on how I can make a readable message in the beginning if it is text so that I can have a message shown?

I know i've seen then on emails before, just can't remember where.

Thanks

Josh

Logician 06-18-2002 06:11 PM

If you put the text before anything else, it would be displayed nicely in html-off viewers but would not be nice in HTML mails. On the other hand if you format this text with HTML, it would be nice in HTML mails but other users will see it in HTML too.

I personally prefer to warn the users not in the email but in the screen where they choose to receive HTML mails. It's why I included the hack the special link part to switch user mail option (the part you can change your mail setting with one click without going into your usercp). I add the "click here to get HTML mails" link to normal (non-HTML) email notification template and if the user clicks it, their settings change but they also get a detail warning about the effects of the this change (get garbage mails) and how to correct it if they encounter these effects (go to user cp and revert back to text mails). My board is not a large one but it seems to work for now. I havent got even one complaint from the members that they cant "read" the mails.

This is my way of dealing with HTML mails, use it if it fits to you too :)

Chris M 06-18-2002 08:22 PM

Nice...

*installs*

Satan

SaintDog 06-18-2002 09:46 PM

Very nice, once vBulletinTemplates is open, it will be using this hack :).

- SaintDog

Logician 06-19-2002 05:42 AM

Quote:

Originally posted by SaintDog
Very nice, once vBulletinTemplates is open, it will be using this hack :).

[high]* Logician waiting vBulletinTemplates impatiently :)[/high]

SaintDog 06-19-2002 06:10 AM

It will open once I get a few more submissions, if you have any template modifications that you are willing to donate, please feel free to send them to webmaster@vbulletintemplates.com - you will be given credit (you can place your website and such in the download file if you choose to as well, extra promotion never hurt anyone ;)).

- SaintDog

Dan Flynn 10-01-2002 02:10 AM

I'm getting this error when I try to run the query.

Database powerwas_vb running on localhost

Error

SQL-query :

ALTER TABLE `$powerwas_vb`.`user` ADD `htmltext` TINYINT UNSIGNED DEFAULT 0 NOT NULL

MySQL said:

alter command denied to user: 'powerwas@localhost' for table 'user'

Any idea why?

Thanks

Logician 10-01-2002 08:15 AM

Quote:

Originally posted by Dan Flynn
alter command denied to user: 'powerwas@localhost' for table 'user' Any idea why?

Dan as your error states, the problem you are having is related to your MYSQL user rights. You are trying to run a SQL query with a user account that does not hold "changing(alter) database" privileges.. You have to contact your host and ask "with which username and MYSQL password you should run ALTER commands", then use these info to run the SQL command..

Dan Flynn 10-01-2002 11:32 AM

Thanks I'll check into that. I'm pretty sure I have ran them before under that name!!!!

ChurchMedia 02-03-2003 08:24 AM

Another great hack! :)

I have the "threadstarter" hack installed, which emails forum subscribers when new threads are started. I'm trying to implement your hack into that one. It goes into the newthread.php.

Here is what I added, along with a new template, but it doesn't seem to work. It just sends out plain text. See anything wrong?

PHP Code:

// Hack: Send email notification on subscribed forums
      
if ($enableemail and $visible) {
        
$tousers=$DB_site->query("SELECT user.username,user.email
                                     FROM subscribeforum,user
                                     WHERE subscribeforum.forumid='
$forumid'
                                       AND subscribeforum.userid=user.userid
                                       AND user.userid<>'
$bbuserinfo[userid]'");
        
$forumtitle=unhtmlspecialchars($foruminfo['title']);
    
$author=unhtmlspecialchars($bbuserinfo['username']);
    
$postsubject=unhtmlspecialchars($subject);
    
$postcontents=unhtmlspecialchars($message);
        while (
$touser=$DB_site->fetch_array($tousers)) {
          
$touser['username']=unhtmlspecialchars($touser['username']);
// Logician HTML mail hack
if ($touserinfo['htmltext']==0){
// user wants plain text messages
          
eval("\$emailmsg = \"".gettemplate("email_threadstarter",1,0)."\";");
          eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");

          
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
        }
      else
//user wants HTML messages
{
eval(
"\$emailmsg = \"".gettemplate("email_threadstarter_html",1,0)."\";");
eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle \" <$webmasteremail>\nMIME-VERSION: 1.0\nCONTENT-TYPE: TEXT/HTML; CHARSET=iso-8859-9\nCONTENT-DISPOSITION: INLINE\n");
}
// Logician HTML mail hack
      
        
}
      }
      
// End hack 

I think I may have a } out of place...

Logician 02-03-2003 10:00 AM

I didn't understand why you are editing newthread.php while installing my hack? My hack does not modify newthread.php in anyway. Please check hack installations carefully, I believe you installed it incorrectly and this is why it does not work.. :knockedout:

ChurchMedia 02-03-2003 01:10 PM

Quote:

Originally posted by Logician
I didn't understand why you are editing newthread.php while installing my hack? My hack does not modify newthread.php in anyway. Please check hack installations carefully, I believe you installed it incorrectly and this is why it does not work.. :knockedout:
This is a "hack of your hack of a hack". I'm trying to make the threadstarter hack, FOUND HERE, work the same way and send out html emails for thread starts. I also want to do it for moderators....

Your hack as described in the instructions is working perfectly. I was just wondering if you could help me with some additional modifications....:)

Logician 02-03-2003 02:08 PM

Quote:

Originally posted by ChurchMedia

Your hack as described in the instructions is working perfectly. I was just wondering if you could help me with some additional modifications....:)

ok I see..

Give this a shot:
PHP Code:

=================================================================
      
// Hack: Send email notification on subscribed forums
      
if ($enableemail and $visible) {
        
$tousers=$DB_site->query("SELECT user.username,user.email,user.htmltext
                                     FROM subscribeforum,user
                                     WHERE subscribeforum.forumid='
$forumid'
                                       AND subscribeforum.userid=user.userid
                                       AND user.userid<>'
$bbuserinfo[userid]'");
        
$forumtitle=unhtmlspecialchars($foruminfo['title']);
    
$author=unhtmlspecialchars($bbuserinfo['username']);
    
$postsubject=unhtmlspecialchars($subject);
    
$postcontents=unhtmlspecialchars($message);
        while (
$touser=$DB_site->fetch_array($tousers)) {
          
$touser['username']=unhtmlspecialchars($touser['username']);
    
// Logician HTML mail hack
        
if ($touser['htmltext']==0){
        
// user wants plain text messages

                  
eval("\$emailmsg = \"".gettemplate("email_threadstarter",1,0)."\";");
              eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");

              
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
        }
         else
        
//user wants HTML messages
        
{
        eval(
"\$emailmsg = \"".gettemplate("email_threadstarter_html",1,0)."\";");
        eval(
"\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");
        
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle \" <$webmasteremail>\nMIME-VERSION: 1.0\nCONTENT-TYPE: TEXT/HTML; CHARSET=iso-8859-9\nCONTENT-DISPOSITION: INLINE\n");
        }
// Logician HTML mail hack

        
}
      }
      
// End hack
================================================================= 

Enjoy..

ChurchMedia 02-03-2003 02:52 PM

Worked perfectly! I see where I messed up -- Thanks a ton!

:) :) :)

SpankMe 02-20-2003 03:00 AM

Is there going to be an update for this hack for vBulletin 2.3.0 which has changed its mail code. https://vborg.vbsupport.ru/external/2010/10/3.gif

Logician 02-20-2003 08:51 AM

Quote:

Is there going to be an update for this hack for vBulletin 2.3.0 which has changed its mail code.
Nope sorry.. My access to vb.com member area has expired and I don't plan to renew it until a stable vb3 release which I'll upgrade comes up..

ryancooper 04-08-2003 05:40 PM

will this work wit hteh email all users option in hte Admin CP. If so it is exactly what i am looking for.

Logician 04-09-2003 06:42 AM

Quote:

Yesterday at 09:40 PM ryancooper said this in Post #30
will this work wit hteh email all users option in hte Admin CP. If so it is exactly what i am looking for.
Nope my hack does not include Admin CP emails but there is another hack for that please search in full releases section in title with keyword "*html*"

ChurchMedia 06-01-2003 06:12 PM

I've noticed that when you add an announcement in the admin CP, that it converts all of your VB code to HTML. Would it be possible to use some of the code from announcement.php to convert VB code in the HTML emails to HTML? Right now you still get a bunch of code in the emails (urls, italics, etc.). It would be cool if those where converted and the code was not visible. Possible??

lalo landa 09-19-2003 07:22 AM

Quote:

Originally Posted by ChurchMedia
I've noticed that when you add an announcement in the admin CP, that it converts all of your VB code to HTML. Would it be possible to use some of the code from announcement.php to convert VB code in the HTML emails to HTML? Right now you still get a bunch of code in the emails (urls, italics, etc.). It would be cool if those where converted and the code was not visible. Possible??


I need the same!!

i use the $message into the html notification mail... and i see the vbcode.. like [vbcode]text[/vbcode]

:(

lalo landa 09-19-2003 07:24 AM

To send html mails with the adminCP

Go to: https://vborg.vbsupport.ru/showthrea...highlight=html

lalo landa 09-19-2003 08:00 AM

Done!!!

to vbcode problem see this hack

https://vborg.vbsupport.ru/showpost....7&postcount=28

and this post
https://vborg.vbsupport.ru/showpost....35&postcount=2

Bye!


All times are GMT. The time now is 03:51 AM.

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.01372 seconds
  • Memory Usage 1,868KB
  • 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
  • (5)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (35)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete