No more New User Registration e-mail notifications

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
7/9/2009 3:42:42 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

No more New User Registration e-mail notifications

Sys op: Server: Win 2003 - Client: Vista
Database: MS SQL 2005
mojoPortal: 2-3-1-0
Browsers: IE 8, Firefox 3.0.11, Google Chrome 2.0.172.30

Hi Joe,

we host 4 mojoPortal web sites (2 for development and 2 for production), each with its separate IIS and MSSQL database configuration.
All of them are set to use their own respective smtp mail account on our Exchange Server.

From one of the production sites, Admins don't receive anymore the e-mail notification when a new user register, despite in user.config we did not change the following:
<add key="NotifyAdminsOnNewUserRegistration" value="true" />

The only change to mail settings was related to the recent set-up of a webstore.
If you can remember, we had some localization issues for the order confirmation message which did not show the correct currency symbols.
To fix that you suggested to disable .NET Open Mail ( <add key="DisableDotNetOpenMail" value="true" /> ).

I've just realized that after that change we did not get any new user notifications form the site.
Is that a coincidence ?

Any suggestions to test and fix the issue ?

Regards.
Diego

7/9/2009 8:59:01 AM
Gravatar
Total Posts 18439

Re: No more New User Registration e-mail notifications

Hi Diego,

Are you seeing any errors in your log? The new user registrationnotification sends mail the same way as the webstore so if webstore is working it seems strange that the new user notification is not working. The only difference I see is that the new user notification uses the site settings default from address for the from address and webstore uses the store sales email address. Do you have different values for those settings or the same?

They both utilize the Email MessageTask which queues a task that sends the email on a background thread. The only other difference is that when the store sends the mail it does not override the task name so it uses "Email Message Task" as the task name but the admin notification is localizing the task name like messageTask.TaskName = Resource.NewUserAdminNotificationTask;

One possible thought is I have seen a few errors in the task queue recently that seems to be caused by the fact that I localize the task name on some tasks and it seems that if the localized task name has some special characters it can fail to start the task. Could you try changing the key "NewUserAdminNotificationTask" in your Resource.it.resx file to english only chars and see if that makes it start working again.

Maybe I need to not localize the task name since this is a background system.

Hope it helps,

Joe

 

7/9/2009 10:39:51 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: No more New User Registration e-mail notifications

Yes, I have set two different From fields for webstore sales and sitesettings.

For your info, I have successfully sent a newsletter which appears to be sent on sitesettings the same way the New User Notification used to.

Localization

Resource.it.resx apparently contains no strange characters:

<data name="NewUserAdminNotificationTask" xml:space="preserve">
<value>Lavoro di notifica UserAdmin</value>
</data>

Anyway, to be sure about localization issues I've temporarily renamed Resource.it.resx to let the site work with the default settings of Resource.resx.
Note that site default culture is "en-US" therefore notifications are sent with the original english template.

Here is the error log which I suppose is related with last user registration (made without Resource.it.resx)
There's 1 hour gap between system log and "MagageUsers > user activity > Created" timestamp, but it may be due to Time Zone Offset (GMT+1 vs. GMT/UTC).


2009-07-09 17:12:42,103 ERROR mojoPortal.Web.EmailMessageTask - System.ArgumentException: The specified string is not in the form required for a subject.
at System.Net.Mail.Message.set_Subject(String value)
at System.Net.Mail.MailMessage.set_Subject(String value)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority, String[] attachmentPaths, String[] attachmentNames)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority)
at mojoPortal.Net.Email.SendEmail(SmtpSettings smtpSettings, String from, String to, String cc, String bcc, String subject, String messageBody, Boolean html, String priority)
at mojoPortal.Web.EmailMessageTask.RunTask()
2009-07-09 17:12:42,150 INFO mojoPortal.Web.EmailMessageTask - started EmailMessageTask task
2009-07-09 17:12:57,010 INFO mojoPortal.Web.WebTaskManager - started WebTaskManager task

What is strange is that all the 4 sites I host have the same localization (the resource and templates I sent you and you have dstributed) and the same setup (apart from mail accounts which are specific and the <add key="DisableDotNetOpenMail" value="true" /> of the troublesome one, but the other 3 work fine.

I hope the Error Log helps you to understand.

7/9/2009 10:54:08 AM
Gravatar
Total Posts 18439

Re: No more New User Registration e-mail notifications

It sounds like it doesn't like something about the subject string. There is a logging statement that may help us see what the subject string looks like when this error happens.

if (log.IsDebugEnabled) log.DebugFormat("In SendEmailNormal({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})",
from,
to,
cc,
bcc,
subject,
messageBody,
html,
priority);

To enable this, you can change the logging level in log4net.config

from this:

<level value="INFO" />
to this
<level value="DEBUG" />

then cause the error and see what gets logged as the subject. It will make the log very noisy so you will want to change it back afterwards.

Hope it helps,

Joe

7/9/2009 12:33:45 PM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: No more New User Registration e-mail notifications

Ok, I made some more tests.

In the DEBUG mode, the system log below reports the two messges sent to the user (for confirmation) and to the Admins (for notification):

2009-07-09 18:00:59,261 DEBUG mojoPortal.Net.Email - In SendEmailNormal(www@effectiveweb.it, daniela.rimoldi@effective.it, , , EffectiveWeb - il portale web della comunità Effective, Grazie per la registrazione su EffectiveWeb - il portale web della comunità Effective!

La tua registrazione sarà confermata cliccando il collegamento di seguito che sblocca il tuo account.
Questa procedura impedisce che altri possano registrarsi usando il tuo indirizzo e-mail.


http://www.effectiveweb.it/ConfirmRegistration.aspx?ticket=fa8ab548-878f-4501-98fb-c36ee5913ef4, False, Normal)

2009-07-09 18:00:59,308 DEBUG mojoPortal.Business.WebHelpers.UserRegisteredHandlers.DoNothingUserRegisteredHandler - DoNothingUserRegisteredHandler called for new user daniela.rimoldi@effective.it
2009-07-09 18:00:59,323 DEBUG mojoPortal.Web.NotifyAdminUserRegisteredHandler - NotifyAdminUserRegisteredHandler called for new user daniela.rimoldi@effective.it
2009-07-09 18:01:00,214 INFO mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task
2009-07-09 18:01:00,214 INFO mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread
2009-07-09 18:01:00,339 INFO mojoPortal.Web.EmailMessageTask - deserialized EmailMessageTask task
2009-07-09 18:01:00,339 INFO mojoPortal.Web.EmailMessageTask - Queued EmailMessageTask on a new thread
2009-07-09 18:01:00,464 DEBUG mojoPortal.Net.Email - In SendEmailNormal(www@effectiveweb.it, www@EffectiveWeb.it, , , New User Notification: daniela.rimoldi@effective.it http://www.effectiveweb.it, A new user has registered on your site EffectiveWeb - il portale web della comunità Effective http://www.effectiveweb.it

You can review or manage this user from the Members List on your site or by following this link:
http://www.effectiveweb.it/Admin/ManageUsers.aspx?userid=21

You are receiving this message because your site is configured to notify Administrators when a new user registers.
If you no longer wish to receive these notifications, you can disable it in your Web.config file by making the following setting false:
<add key="NotifyAdminsOnNewUserRegistration" value="false" />, False, Normal)

2009-07-09 18:01:00,464 ERROR mojoPortal.Web.EmailMessageTask - System.ArgumentException: The specified string is not in the form required for a subject.
at System.Net.Mail.Message.set_Subject(String value)
at System.Net.Mail.MailMessage.set_Subject(String value)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String
subject, String messageBody, Boolean html, String priority, String[] attachmentPaths, String[] attachmentNames)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String replyTo, String to, String cc, String bcc, String
subject, String messageBody, Boolean html, String priority)
at mojoPortal.Net.Email.SendEmailNormal(SmtpSettings smtpSettings, String from, String to, String cc, String bcc, String subject, String
messageBody, Boolean html, String priority)
at mojoPortal.Net.Email.SendEmail(SmtpSettings smtpSettings, String from, String to, String cc, String bcc, String subject, String messageBody,
Boolean html, String priority)
at mojoPortal.Web.EmailMessageTask.RunTask()
2009-07-09 18:01:00,479 INFO mojoPortal.Web.EmailMessageTask - started EmailMessageTask task

 

I have noticed that Site Name included in Subject has a vowel with an accent so I changed the sitename changing fomr (à) to (a') > Same error!

I have also temporarily changed the default template to exclude the sitename from the subject > same error.

The user who register receives its confirmation request message but the Admin does not receive the notification.

I could not find any syntax problem in In SendEmailNormal statement, do you ?

7/9/2009 1:02:23 PM
Gravatar
Total Posts 18439

Re: No more New User Registration e-mail notifications

Hi Diego,

Can you try a small experiment for me, can you edit the subject template so it has nothing but  {0}{1}, and edit the message body template so it has only {0}{1}{2}

and see if that makes the error go away?

If that does solve it try putting everything back as itwas excpet leave out this part of the body and see if it still works or not:

<add key="NotifyAdminsOnNewUserRegistration" value="false" />

This message is sent separately from the one the user sees so errors happening here do not affect the user message. 

Thanks,

Joe

7/9/2009 1:32:48 PM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: No more New User Registration e-mail notifications

Ok,

by removing all text apart from parameters {0}{1} in subject {0}{1}{2} in message body, it works.

by resetting the original templates leaving out <add key="NotifyAdminsOnNewUserRegistration" value="false" /> in message body, it doesn't work.

I have also tested this:

subject : leaving just {0}{1}
message: original

It does not work. 

7/9/2009 1:47:23 PM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: No more New User Registration e-mail notifications

Joe,

thinking about it, it must be something in the subject template.

So I edited the original file and I found that it included two lines.
I removed the CR/LF and tried again.

It worked !!!

I still don't understand why the same template works in the other sites.

The only difference I can see is that this website has .Net Open Mail disabled, but I don't know how this coud work.

If this is the reason, there may more templates to fix when disabling .Net Open Mail.

7/9/2009 2:30:56 PM
Gravatar
Total Posts 18439

Re: No more New User Registration e-mail notifications

Hi Diego,

Glad it is sorted out. It must be some difference in the way the built in email classes handle line endings vs the way dotnetopenmail handles them.

So was this the english file that was messed up? Can you send me the fixed file(s). Possibly this was the result of adding some templates from a linux machine as line ending are different on linux. In the early days of the project I did not know about some svn configurations to keep line endings sane across machines when checking files into the repository so its possible the file had some funky line endings that created this corner case issue in some installations if its been around for a long time.

Best,

Joe 

7/10/2009 1:25:10 AM
Gravatar
Total Posts 149
Partner
mojoPortal Skinning, Custom Development and Support in Italy?
EffectiveWeb.it

Re: No more New User Registration e-mail notifications

Yes It was the enghlish file.

I have sent you the fixed files by e-mail

Regards.
Diego

You must sign in to post in the forums. This thread is closed to new posts.