set membership signup to default to "disabled"

39 posts by 6 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 19, 2012   (RSS)

By Jason - May 17, 2010

No problem.

It treats everything between the __TEXT__ lines as plain text that is assigned to a variable.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] set membership signup to default to "disabled"

By gkornbluth - May 17, 2010


So, it's a PHP thing not an e-mail thing.

Thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By kdub718 - July 17, 2012

I know this is a very old post but do you have this plugin available? Would you mind if I use it?

By kdub718 - July 17, 2012

Worked like a charm! Thank you so much!!

Do you have any ideas on how I could have an email sent to the site admin when a new user signs up?

Re: [kdub718] set membership signup to default to "disabled"

By gkornbluth - July 17, 2012

Hi Kdub718,

There's a plugin called alert record saved that could give you some ideas.

Search for alert record saved, all words on the forum and see how far you can get.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By kdub718 - July 17, 2012

I was thinking about just re activating the send message.

using this:

'to' => $SETTINGS['adminEmail'],

instead of the $Request ['email'] version.

then obviously modifying the email part accordingly. I haven't tried it yet but I don't see why it wouldn't work... I just don't know if it would be bad practice to do it that way or if I'm overlooking something

Re: [kdub718] set membership signup to default to "disabled"

By kdub718 - July 19, 2012 - edited: July 19, 2012

So it seems the email thing works just fine the way I want it to but if I change the call out from say "<?php echo htmlspecialchars($PLACEHOLDERS['username']) ?>" to my own field like "<?php echo htmlspecialchars($PLACEHOLDERS['fullname']) ?>" or any other I add to customize the email that's sent I get this error within the email that's sent.

"Notice: Undefined index: fullname in /home/content/html/admin/plugins/websiteMembership/emails/user-new-signup.php on line 46"

So this is the user-new-signup.php
<?php

// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/content/html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
if (!@$GLOBALS['WEBSITE_MEMBERSHIP_PLUGIN']) { die("You must activate the Website Membership plugin before you can access this page."); }

// Override email headers - uncomment these to override the values set by the calling program
global $SETTINGS, $FROM, $TO, $SUBJECT, $PLACEHOLDERS;
$FROM = $SETTINGS['adminEmail'];
//$TO = $SETTINGS['adminEmail']; // set by program
$SUBJECT = "Re: Trade Account Approval";

// Preview Mode: Allow developers to view email template directly for easy editing
$isPreviewMode = isBeingRunDirectly();
if ($isPreviewMode) { // these values only show when previewing email template directly
$TO = "preview@example.com";
$PLACEHOLDERS = array();
$PLACEHOLDERS['username'] = 'testuser';
$PLACEHOLDERS['password'] = 'password123';
$PLACEHOLDERS['loginUrl'] = "#loginUrl";
}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
body, td { font-family: arial }
</style>
</head>
<body>

<?php
// developer preview mode: show email headers when viewing email template directly
if ($isPreviewMode) { emailTemplate_showPreviewHeader(); }
?>

Hi <?php echo htmlspecialchars($PLACEHOLDERS['fullname']) ?>, is requesting a trade account<br/><br/>

Thanks for signing up to <?php echo htmlspecialchars($_SERVER['HTTP_HOST']) ?>.<br/><br/>

Your username is: <?php echo htmlspecialchars($PLACEHOLDERS['fullname']) ?><br/>
Your password is: <?php echo htmlspecialchars($PLACEHOLDERS['password']) ?><br/><br/>


</body>
</html>


So do I have to call out what fields I want to use somewhere else?

Re: [kdub718] set membership signup to default to "disabled"

By Jason - July 19, 2012

Hi,

In order for a placeholder to work on the email, you must make sure you pass it to the template when sending the email on your signup page.

for example:

$emailHeaders = emailTemplate_load(array(
'template' => websiteLogin_pluginDir() . "/$emailTemplate",
'subject' => '', // set in template
'from' => '', // set in template
'to' => $_REQUEST['email'],
'placeholders' => array(
'username' => array_key_exists('username', $_REQUEST) ? $_REQUEST['username'] : $_REQUEST['email'], // if using email as username then show that instead
'password' => $password,
'loginUrl' => "http://" . $_SERVER['HTTP_HOST'] . $GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL'],
'fullname' => @$_REQUEST['fullname'],
),
));


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/