Resend Activation URL Mod - Instructions

17 years 9 months ago #14641 by moneybagsxp
Resend Activation URL Mod - Instructions was created by moneybagsxp
First Request
Too bad you can't resend the activation URL...It's one thing to have the user custom request a resend, but at a minimum, the admin should be able to spawn one via the User Manager section of CB.

Many users are finding that their spam/bulk folders are being filled with the activation emails, and are being cleared before they have a chance to follow the link.

Now what?


Second request
That would be sooo sweet if CB User Manager would allow filtering by status! A simple way to only view Non-approved, or Non-confirmed, etc. Should be pretty simple and would add GREAT value!

PS
Here is a way to do it via SQL should you need it:
This displays all non-confirmed user's name/email/id, sorted by most recent registration.

[code:1]
select
cb.id, usr.name,usr.email
from
jos_comprofiler cb,
jos_users usr
where
cb.confirmed <> 1
and usr.id = cb.id
order by
cb.id desc
[/code:1]


Merged
I plan on taking the SQL from suggestion #2 and looping through the result set to spawn custom "reminder" activation emails to our users. I will then dig up the code that creates the "activation key" for the URL so that I can include it in each email. We currently have ~500 who have not confirmed, so this is big for us, next closest thing to automated-suggestion #1. Once successful, will be creating a mod to allow customer requests for Activation links to be resent.

Post edited by: moneybagsxp, at: 2006/06/05 20:49

www.pixelchutes.com - Where every pixel matters.

Please Log in to join the conversation.

17 years 9 months ago #14709 by moneybagsxp
Replied by moneybagsxp on topic Resend Activation URL Admin Mod - Gotta have it
moneybagsxp wrote:

Merged
I plan on taking the SQL from suggestion #2 and looping through the result set to spawn custom "reminder" activation emails to our users. I will then dig up the code that creates the "activation key" for the URL so that I can include it in each email. We currently have ~500 who have not confirmed, so this is big for us, next closest thing to automated-suggestion #1. Once successful, will be creating a mod to allow customer requests for Activation links to be resent.


Update!

I have successfully designed a SWEET Activation URL Resend mod to CB 1.0 Stable with features such as:
  1. Administrators can resend Activation URLs from User Management page with one click
  2. AJAX submission-handling to allow multiple individual requests without leaving the current view
  3. Config Considerate: Can only resend to Unconfirmed, and can't resend if global options have Confirmation emails disabled.
  4. Customizable Email Message and Subject under the Registration tab, inline with the Welcome and Pending emails, allowing for Value Placeholders such as [CONFIRM], etc.
  5. Delimited parameters allow for numerous Activation URLs to be resent with just one request (more user friendly version to come)

I will be posting the easy, detailed instructional steps to perform this Mod yourselves!

www.pixelchutes.com - Where every pixel matters.
The following user(s) said Thank You: mohammadx90

Please Log in to join the conversation.

17 years 9 months ago #14764 by moneybagsxp
Replied by moneybagsxp on topic Resend Activation URL Admin Mod - Instructions
Alright gang, here it is! Follow these simple steps, and you'll have the ability to resend confirmation/activation URLs to unconfirmed users through AJAX!

Tested/Confirmed using Joomla 1.0.7 to 1.0.11 and CB 1.0 stable to 1.0.1 ...thanks to skunk for providing a link to pre-modded CB files on page 6!


components/com_comprofiler/plugin/language/default_language/default_language.php (line 140) define display variables:
[code:1]
DEFINE('_UE_REG_CONFIRM_RESEND_SUB','Resend Activation URL Email Subject');
DEFINE('_UE_REG_CONFIRM_RESEND_DESC','Resend Activation URL Email Subject');
DEFINE('_UE_REG_CONFIRM_RESEND_MSG','Resend Activation URL Email');
[/code:1]

administrator/components/com_comprofiler/admin.comprofiler.html.php (line 1865) add HTML:
[code:1]
<tr align="center" valign="middle">
<td align="left" valign="top"><?php echo _UE_REG_CONFIRM_RESEND_SUB ?></td>
<td align="left" valign="top"><input type="text" name="cfg_reg_confirm_resend_sub" value="<?php echo stripslashes($ueConfig); ?>" /></td>
<td align="left" valign="top"><?php echo _UE_REG_CONFIRM_RESEND_DESC ?></td>
</tr>
<tr align="center" valign="middle">
<td align="left" valign="top"><?php echo _UE_REG_CONFIRM_RESEND_MSG ?></td>
<td align="left" valign="top" colspan=2><textarea name="cfg_reg_confirm_resend_msg" cols=50 rows=6><?php echo stripslashes($ueConfig); ?></textarea></td>
</tr>
[/code:1]

administrator/components/com_comprofiler/admin.comprofiler.php (line 326) add JavaScript case statement:
[code:1]
case 'resendActivation':
resendActivation();
break;
[/code:1]

administrator/components/com_comprofiler/admin.comprofiler.php (line 44) add the following:
[code:1]
$rid = trim( mosGetParam( $_REQUEST, 'rid', null ) );
[/code:1]

administrator/components/com_comprofiler/admin.comprofiler.php (line 2634) add PHP function:

[code:1]
// Ajax: administrator/index3.php?option=com_comprofiler&task=resendActivation&no_html=1&rid=X :
function resendActivation(){
global $database, $mosConfig_absolute_path, $mosConfig_live_site, $ueConfig, $rid;

$i=0;
if( !empty( $rid ) )
{
$row_ids = explode(",",$rid);
foreach( $row_ids as $row_id )
{
if( !empty( $row_id ) )
{
$query = "SELECT * FROM #__comprofiler c, #__users u WHERE c.id=u.id AND c.id =" . $row_id;
$database->setQuery($query);
$user = $database->loadObjectList();

$cbNotification = new cbNotification();
$cbNotification->sendFromSystem($user[0],getLangDefinition($ueConfig),getLangDefinition($ueConfig)) || die('error');
$i++;
}
}
}
else echo 'Nothing to process.';

echo ($i>0)?($i>1)?$i.' sent!':'sent!':'';
}
[/code:1]

administrator/components/com_comprofiler/admin.comprofiler.html.php (line 1450) change this line to and add the following:

[code:1]
global $mosConfig_offset, $ueConfig;

if( $ueConfig == "1" )
{
?>


<script type="text/javascript"><!--//--><![CDATA[//><!--

function makeRequest(url,id) {

var http_request = false;

if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
// See note below about this line
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}

if (!http_request) {
// alert('Giving up: Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function() { alertContents(http_request,id); };
http_request.open('GET', url, true);
http_request.send(null);

}

function alertContents(http_request,id) {

if (http_request.readyState == 4) {
if ((http_request.status == 200) && (http_request.responseText.length < 1025)) {
document.getElementById(id).innerHTML = http_request.responseText;
} else {
document.getElementById(id).innerHTML = 'There was a problem with the request.';
}
}

}

function cbResendConfirmURL(id,rid) {
document.getElementById(id).innerHTML = '<font color="#cccccc">hold...</font>';
makeRequest('index3.php?option=com_comprofiler&task=resendActivation&no_html=1&rid='
+rid,id);
return false;
}

function cbAddEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, true);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
} else {
return false;
}
}

//--><!]]></script>

<? }
[/code:1]

(NOTICE: You may need to add an ending ?> tag at the end to complete the php statement, this is only if the NEXT line begins with <?php (or you could optionally just remove the opening <?php tag!)

administrator/components/com_comprofiler/admin.comprofiler.html.php (line 1522) add the following BEFORE '</td>':

[code:1]
<?php if( !$row->confirmed and $ueConfig == "1" ){ ?>
<span id="cbResendActivation<?php echo $row->id; ?>"><a href="#resend_now" onclick="return cbResendConfirmURL(this.parentNode.id,<?php echo $row->id; ?> );" title="Resend Activation URL Now!">resend</a></span>
<?php } ?>
[/code:1]

Final step:
  1. Log into Joomla Admin
  2. Browse to Community Builder Configuration
  3. Click on the Registration tab
  4. Enter text for Resend Activation URL Email Subject and Resend Activation URL Email. NOTE: You may want to simply copy your email/subject from Pending Approval Email

You're all set B)


Easter Egg:

To resend Activation URLs to MULTIPLE individuals, there is a method for performing this task! Currently, there is not a friendly interface to do so, but it can be done!

First, identify those users who have not been Confirmed.
Personally, I would use SQL for this step.

This will give you the row ID of all unconfirmed users.

[code:1]
select
cb.id
from
jos_comprofiler cb,
jos_users usr
where
cb.confirmed <> 1
and usr.id=cb.id
[/code:1]

Then, you simply take this list and delimit by comma, passing in as &rid= to the following link.

Here's an example (You must be logged in as administrator First, then manually browse to the URL)

[code:1]
http://www.your-site-here-.com/administrator/index3.php?option=com_comprofiler&task=resendActivation&no_html=1&rid=1,10,55,200
[/code:1]

Post edited by: moneybagsxp, at: 2006/11/03 19:43

www.pixelchutes.com - Where every pixel matters.

Please Log in to join the conversation.

17 years 9 months ago #14821 by nickjo
Seems to work like a charm, I'm having a couple of small issues, I'll have to revisit my cut and paste :)

blwebsolutions.com

Please Log in to join the conversation.

17 years 9 months ago #14834 by moneybagsxp
Replied by moneybagsxp on topic Re:Resend Activation URL Admin Mod - Instructions
nickjo wrote:

Seems to work like a charm, I'm having a couple of small issues, I'll have to revisit my cut and paste :)


Hmm...what kind of issue(s) have you noticed? Are you receiving the email? Does the link change from "send" to "hold..." to "sent!" or to "error" ?

I'm interested in knowing, I'd like to know that I documented my steps/line numbers correctly, and will make edits for future users, if necessary.

NOTE: The beauty of this mod is that I'll soon allow members to enter username and/or email to have it resend activation URL in case they misplaced it. B)

Post edited by: moneybagsxp, at: 2006/06/07 03:29

www.pixelchutes.com - Where every pixel matters.

Please Log in to join the conversation.

17 years 9 months ago #14851 by nickjo
I have to go back through and revisit the code. When I try to send a user an activaition e-mail via the backend the button : resend appears but when you select the user nothing happens. So I think it might be something on my end that I messed up on. I'll have a write up for you tomorrow.

blwebsolutions.com

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.373 seconds

Facebook Twitter LinkedIn