Include OG in Registration E-mail

l33tpolicywonk - January 19, 2009 - 18:42
Project:User registration notification
Version:6.x-1.9
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,

I'm trying to modify this module to include the OG a user selects at registration in the e-mail. Can anyone offer some advice as to how to implement this feature? Thanks.

#1

rmiddle - January 19, 2009 - 19:03
Category:support request» feature request
Status:active» postponed (maintainer needs more info)

The spot to add the data is in user_register_notify_mail. Do you have any info out where you get the info from. If so I can look at adding support.

Thanks
Robert

#2

l33tpolicywonk - January 19, 2009 - 20:43

Robert,

Thanks for your help.

From what I'm seeing, you basically have to pull nid from the table og_uid where uid is the new registered user, then take that nid and use it in table og to find description.

In order to do that, I wrote:

$result2 = db_query('SELECT nid FROM {og_uid} WHERE uid = %d', $og->nid);
$result3 = db_query('SELECT og_description FROM {og} WHERE nid = ' . $og->nid, $og->name);

But I'm not having much luck getting it to work.

Chase

#3

rmiddle - January 20, 2009 - 21:16
Status:postponed (maintainer needs more info)» active

I can see you sql isn't right. Let me look into it adding basic support.

Thanks
Robert

#4

rmiddle - January 20, 2009 - 22:27

l33tpolicywonk,

Replace user_register_notify.module with this file and try it out. It seems to be working for me. Once you confirm this works I will add OG support to the module.

Thanks
Robert

AttachmentSize
user_register_notify.patch 6.3 KB

#5

rmiddle - January 20, 2009 - 22:28
Status:active» needs review

#6

l33tpolicywonk - January 21, 2009 - 00:30

Thanks for your help, Robert.

I got the following error:

user warning: Unknown column 'o.description' in 'field list' query: SELECT o.description FROM og_uid u INNER JOIN og o ON o.nid = u.nid WHERE uid = 224 in /home/ejnet/public_html/earthrights/course/modules/user_register_notify/user_register_notify.module on line 137.

I'm sorry, I don't have database access, so I can't check the attribute name. Thanks for helping me through this.

#7

rmiddle - January 21, 2009 - 01:14

OK I see the issue. OG changed it DB structure from 5 to 6 and I missed that. Try this version. Same thing just replace the module file with this one.

Thanks
Robert

AttachmentSize
user_register_notify.patch 6.3 KB

#8

l33tpolicywonk - January 21, 2009 - 01:33

Two issues:
1) For some reason, profile information no longer appears in the e-mail. Did this structure change in D6 as well?
2) The information given is the OG description, not its name.

Thanks!

#9

rmiddle - January 21, 2009 - 01:36

Check back in a few. I will look at the database some.

Thanks
Robert

#10

rmiddle - January 21, 2009 - 01:39

OK I figured out the issue with the profile. Let me look at adding the name as well as the description.

Thanks
Robert

#11

rmiddle - January 21, 2009 - 02:06

Ok updated one.

#12

rmiddle - January 21, 2009 - 02:07

Helps to include the file. Here is the latest version.

AttachmentSize
user_register_notify.patch 6.39 KB

#13

l33tpolicywonk - January 22, 2009 - 00:12
Status:needs review» reviewed & tested by the community

This patch works perfectly ... thanks!

#14

rmiddle - January 22, 2009 - 01:39
Status:reviewed & tested by the community» fixed

OK. It is included in the 1.10 version. There is also a small change in the admin section telling you the !og is now available.

Thanks
Robert

#15

System Message - February 5, 2009 - 01:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.