After enabling this module, I started having some issues with user registration. Upon registering, users are supposed to be sent a "pending approval" email. However, that email isn't sending. The email to the Administrator is sending, but all the variables like !username are blank.

Any ideas? Disabling the registration module corrected the issue.

Comments

brei9000’s picture

I am using Drupal version 6.14

aidanlis’s picture

Can you try the development version and let me know if that fixes the problem?

Kristina-2’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Priority: Normal » Critical

Hi.

I'm having the same issue on the dev version.

When I test registration the user gets "Unable to send e-mail. Please contact the site administrator if the problem persists."

The e-mail to the admin is sent, but the one to the user fails.

joachim namyslo’s picture

Well, I got a similar problem here. If I send a mail with the message funktion of this module I got empty mails on the end user side. I've installed

mailer
html mail
smtp authentication

perhaps there are some compatibility issues

Kristina-2’s picture

Has this been resolved?

Kristina-2’s picture

Version: 6.x-1.x-dev » 6.x-1.4

Registration codes 6.x-1.4
Drupal 6.15

Still getting the two messages below when I create a user account as an admin and check off notify user of account.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Password and further instructions have been e-mailed to the new user .

Kristina-2’s picture

Trying with the dev version from Oct 21.

Same problem.

Unable to send e-mail. Please contact the site administrator if the problem persists.

Kristina-2’s picture

Hi.
I ran another test on a brand new clean install with no other modules installed.
Drupal 6.15
Dev version of Reg Code

This occurs when an administrator tries to create an account for a user when notify user is checked off.

Unable to send e-mail. Please contact the site administrator if the problem persists.

No e-mail is sent to the administrator.

If an anonymous user created an account you get:

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

The admin account receives this via e-mail:

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

While the user receives nothing.

Here's a copy of the errors in the log:

Type mail
Date Thursday, December 17, 2009 - 23:23
User Anonymous
Location http://qwodev.kristinahall.ca/user/register
Referrer http://qwodev.kristinahall.ca/user/register
Message Error sending e-mail (from info@qwodev.kristinahall.ca to ).
Severity error
Hostname 216.246.226.172
Operations

Type mail
Date Thursday, December 17, 2009 - 23:20
User Admin
Location http://qwodev.kristinahall.ca/admin/user/user/create
Referrer http://qwodev.kristinahall.ca/admin/user/user/create
Message Error sending e-mail (from info@qwodev.kristinahall.ca to ).
Severity error
Hostname 216.246.226.172
Operations

This is a problem that has been going on since end of October with the development release.

Kristina-2’s picture

1. Is the e-mail address filled in under Site information?
- Yes the e-mail field at http://qwodev.kristinahall.ca/admin/settings/site-information is correct, and filled in.
2. Under modules, is Simple Mail enabled?
- I don't have simple mail installed. This is a clean install with just the Registration Code module.
3. Do you have SMTP Authentication Support?
- I do not have this module installed.
4. Do you have a default mail sending method selected under Messaging & Notifications?
- Messaging & Notifications does not seem to be an option in Administration in Drupal 6.15
5. If you have SMTP Authentication, (under Site configuration>>SMTP Authentication Support) in its "E-mail from name option", is it filled in? It says it should automatically use the site's information if you leave it blank, but due to some bug, I noticed it does not, and gives me the same error message you get.
- Site configuration>>SMTP Authentication Support -- don't see this option in Drupal 6.15.

Someone recommended I try the SMTP Authentication Support module to temporarily fix this problem. 7
SMTP Authentication Support v 6.x-1.0-beta4.

Ran a test and got:
"Invalid address: You must provide at least one recipient email address."

With SMTP Installed, and without Reg Code installed the system sends welcome e-mails without problems.
Without SMTP Installed, and without Reg Code installed the system sends welcome e-mails without problems.
With having SMTP installed or not installed and Reg Code installed the users e-mail address (the 'to' field of the e-mail) gets lost.

I would say this problem is a real issue because it cripples user registration.

Kristina-2’s picture

Title: Email to registered user not sending on registration » Welcome e-mail not sending.
Version: 6.x-1.4 » 6.x-1.x-dev

Spent a long time tonight troubleshooting this problem with nadavoid on IRC. We looked specifically at function regcode_user.

The best I get it to is sending a proper user e-mail (hoorah), and an admin e-mail which still fails to display a user name or proper url.

Below is all the tests I went through in hopes it will help someone resolve this problem.

Test 1:

Commented out case register in switch $op.
Found it removed the registration code field on the registration form.
This makes sense.

Test 2:

Case register is uncommented.
Case validate is commented.
Get error and success message.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

Admin e-mail sends with no user name.

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

No user message is sent.

Test 3:

Case register is uncommented.
Case validate is uncommented.
Case insert is commented.
Receive success message.

Your password and further instructions have been sent to your e-mail address.

User message sent.

Test3,

Thank you for registering at Queer Women Ottawa DEV. You may now log in to http://qwodev.kristinahall.ca/user using the following username and password:

username: Test3
password: m8CbiyxVQb

You may also log in by clicking on this link or copying and pasting it in your browser:

http://qwodev.kristinahall.ca/user/reset/18/1261204110/0f0c28cb152673534...

This is a one-time login, so it can be used only once.

After logging in, you will be redirected to http://qwodev.kristinahall.ca/user/18/edit so you can change your password.

-- Queer Women Ottawa DEV team

No admin message is sent.

Test 4:

Case register is uncommented.
Case validate is commented.
Case insert is commented.
Receive success message.

Your password and further instructions have been sent to your e-mail address.

User message sent.

Test4,

Thank you for registering at Queer Women Ottawa DEV. You may now log in to http://qwodev.kristinahall.ca/user using the following username and password:

username: Test4
password: z5MZ5CBWTY

You may also log in by clicking on this link or copying and pasting it in your browser:

http://qwodev.kristinahall.ca/user/reset/19/1261204325/c81463bda89182112...

This is a one-time login, so it can be used only once.

After logging in, you will be redirected to http://qwodev.kristinahall.ca/user/19/edit so you can change your password.

-- Queer Women Ottawa DEV team

No admin message.

Test5:

Change current case register to:

case 'register':
$form['regcode_code'] = array(
 '#type'        => 'textfield',
'#title'       => variable_get('regcode_field_title', 'Registration Code'),
'#description' => variable_get('regcode_field_description', 'Please enter your registration code.'),
'#required'    => !$code_optional,
);
return $form;
break;

Case register is uncommented.
Case validate is commented.
Case insert is commented.
Received success message.

Your password and further instructions have been sent to your e-mail address.

User message sent.

Test5,

Thank you for registering at Queer Women Ottawa DEV. You may now log in to http://qwodev.kristinahall.ca/user using the following username and password:

username: Test5
password: 5dpGbstkUj

You may also log in by clicking on this link or copying and pasting it in your browser:

http://qwodev.kristinahall.ca/user/reset/20/1261204551/c246360c90cceb28f...

This is a one-time login, so it can be used only once.

After logging in, you will be redirected to http://qwodev.kristinahall.ca/user/20/edit so you can change your password.

-- Queer Women Ottawa DEV team

No admin message is sent.

Test6

Case register is uncommented, and keeps new code from test5.
Case validate is commented.
Case insert is uncommented.
Gives error and success message.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

Admin e-mail is sent with no user name.

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

User e-mail was not sent.

Test7

Case register is uncommented, and keeps new code from test5.
Case validate is uncommented.
Case insert is commented.
Success message.
User message sent.
Admin message not sent.

Kristina-2’s picture

I got an e-mail from aidanlis. He pointed me to the function in the module for regcode_mail and the key he have used is not unique and should be renamed. I ran a search for this but was not able to find such a function.

I did find function regcode_mailer_mail($key, &$message, $params) in regcode_mailer.module

$key is used only in regcode_mailer files.
regcode_mailer\regcode_mailer.module(111): foreach ($code as $key => $token) {
regcode_mailer\regcode_mailer.module(112): $tokens['@' . $key] = $token;
regcode_mailer\regcode_mailer.module(165): function regcode_mailer_mail($key, &$message, $params) {
regcode_mailer\regcode_mailer.module(166): switch($key) {

Will rename $key in that function to mailkey to see what happens when run without anything commented out in regcode.module.
Got error and success message.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

Received admin mail

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

User mail failed to send.

Will try renaming the $key to $mailkey and see what happens.
Admin mail is:

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

User mail failed to send. :/

All I can guess is maybe some values are not being passed along in order to fulfill what hook_mail needs or something.
http://api.drupal.org/api/function/hook_mail/6

Kristina-2’s picture

I ended up finding another module that suits my needs but does not function the way reg code does.

I did this because of the fact I originally commented on this November 8, 2009 and still there has been no support by anyone about this serious issue that essentially cripples user registrations.

I only have this time off to work on development of my site and if I wanted to move ahead I had to find another solution.

I hope this problem will get resolved eventually because it is a good module.

aidanlis’s picture

Hi Kristina,

I'm sorry I haven't been able to pay this much attention ... I have no idea why this is happening, I've asked a few people to take a look and they don't know either ...

Kristina-2’s picture

It's bizarre. Hopefully the testing I did will be of use to track down the problem.

This is the only module that offers registration code functionality for 6.x so I'm sure theres more than 2 people having issues.

aidanlis’s picture

Status: Active » Fixed

Took me most of the day but I finally worked it out ... basically in hook_user_insert the $edit array is unset when module_invoke_all fails to find any implementers. This causes all of the email problems because there's no "to" address when the object finally arrives at the mailer.

Please download and test the development release and let me know if it's fixed! Sorry for the time it's taken to get this resolved, and thank you Kristina, your test cases were very helpful.

Ela’s picture

hi there.. testing the new dev version... emails are sent fine but for some reason I also get 2 additional emails notifying me that I (the administrator) have modified my account... which I did not... not sure how the administrator account even relates to the creation of a new account.. but it is what's going on when I crate a new account using registration form with a registration code. The new user gets an email, I get an email of the creation of new user, and 2 emails that the user 1 modified his account...

aidanlis’s picture

I've tested the module via the user/register page and also the admin/user/user/create page, and I don't see the behaviour that you're seeing in #16, Ela.

If you're still getting the behaviour and you haven't got any other funny modules installed (drupal doesn't send me an email when I modify the admin account, do you have a security module installed?) please open a new bug.

I assume everyone has had enough time to test this dev release, so I'm going to release the package now.

Ela’s picture

I'm not sure why it was happening.. but when other users create an account this does not happen, it only happened when I was the one creating accounts.. weird.. who knows why.. but I'm not worried about it since it does not seem to happen with actual users :)
Thank you for great module!!!! :)

Status: Fixed » Closed (fixed)

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

taohai’s picture

almost the same problem, i think