The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
HTML welcome-email code
I’m trying to make a plugin that will enable an HTML ‘welcome email’ when a user signs up. The problem seems to be that the $headers string is set to 'Content-Type: text/plain' and it needs to be 'Content-Type: text/html'.
There are already plugins that let admins send HTML emails to users that use this code to get around the problem: Code:
if ($vbulletin->userinfo['usergroupid'] == 6) { if(strlen($message) != strlen(strip_tags($message))) { $headers = str_replace('Content-Type: text/plain', 'Content-Type: text/html', $headers); } } I will of course bundle it up into a plugin for everyone to use once it is complete. --------------- Added [DATE]1299104905[/DATE] at [TIME]1299104905[/TIME] --------------- Update: Okay I've made some progress. The problem appears to be with the conditional which only works for adminCP emails sent from "users --> send email to users". Code:
if ($vbulletin->userinfo['usergroupid'] == 6) So long story short... I need an additional condition that figures out whether this is the 'welcome email' or some other email. Then I can plug it in like this; Code:
if ($vbulletin->userinfo['usergroupid'] == 6 || welcomemail_conditional == true) {... ...} --------------- Added [DATE]1299145970[/DATE] at [TIME]1299145970[/TIME] --------------- Further update: I have made a solution that works for me, but which isn't dynamic enough to be packaged into a plugin that will work for everyone. What you need to do is set your $vbphrase[welcomemail] phrase to something specific, like "Thanks for joining Sitename". Then edit the code below as needed: Code:
if ($vbulletin->userinfo['usergroupid'] == 6 || $subject == 'Thanks for joining Sitename') { if(strlen($message) != strlen(strip_tags($message))) { $headers = str_replace('Content-Type: text/plain', 'Content-Type: text/html', $headers); } }
|
#2
|
|||
|
|||
any indication of what file this needs to be added to so we can allow html emails with the welcome msg and in turn add a logo image.
Thanks |
#3
|
|||
|
|||
It isn't a file modification, its a plugin. So you need to go to plugin manager, add new plugin, and use the hook "mail_send". Hope that helps and is accurate.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|