Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Blank password on e-mail notification after custom user enrollmentBlank password on e-mail notification after custom user enrollment
Previous
 
Next
New Post
5/13/2009 1:39 PM
 

I created a custom module for enrolling users.  I used the code at http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/275/creating-a-dotnetnuke-user-account-from-code.aspx

It creates the user just fine but I also need to send e-mail notification since the new user's password is generated.  With so many layers to DNN it is hard to figure out what the proper call to use to get the notification sent properly.  I used Reflector and figured I should be able to do this:

Mail.SendMail(user,MessageType.UserRegistrationPublic, PortalSettings);

It seems simple enough to just pass the UserInfo object in, which does have the password set, but when the e-mail is sent, the password part of the e-mail is blank.  If I create a new user via the typical admin screen I get the password just fine.  I've dug through the SendMail code and I don't see why the password wouldn't be sent. 

Any ideas on why SendMail isn't working right?

Is there a better way to go about sending the e-mail?

Thanks, Peter

 

 
New Post
5/13/2009 3:38 PM
 

Wow, embarrassing.  After troubleshooting all day yesterday, downloading the source to debug today, figuring out that it would be best to upgrade to 4.9.3 first, and finally debugging, I looked in UserInfo object inside SendMail and Password was null.  I knew it was set properly so I went back to my code and the problem was staring me in the face.  I also needed to add new roles to the new user so after creating the user I did a "user = UserController.GetUserByName(PortalId, user.UserName)" which returns the same user without the password of course.

Clearly I had been staring at the code too long not to nice that.

Just embarrassing...

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Blank password on e-mail notification after custom user enrollmentBlank password on e-mail notification after custom user enrollment


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out