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

HomeHomeDevelopment and...Development and...Getting StartedGetting Startedcreate a batch job to send localised email notificationscreate a batch job to send localised email notifications
Previous
 
Next
New Post
3/2/2011 12:49 PM
 
Hi

I want to build a scheduled task that can send a localised email to a user. For example, we have on module where a user makes a document request. This action will be logged in a table.  The batch prog picks up the job and sends the user an email with a link to the document. The job table will contain information about the users locale. It then sends the user an email in their preferred language.

I have no problem with the schedule job and I know how to use DotNetNuke.Services.Mail to send emails. However, I would like to use the languages system to create localised email templates like the core verification & password reminder ones.

I have found this method that would enable me to send the standard notifications based on MessageType.

public static string SendMail( UserInfo user, MessageType msgType, PortalSettings settings )

However, how would I add my own MessageType? The existing types are:

PasswordReminder
ProfileUpdated
UserRegistrationAdmin
UserRegistrationPrivate
UserRegistrationPublic
UserRegistrationVerified
UserUpdatedOwnPassword
ToJson

I'd like to be able to add something like   "DocumentRequestLink".   Also, how does one pass in the locale?  How does the core dnn framework send a message based on locale?

Any ideas?  It would be really useful if someone could explain. I bought Mitchel Sellers book but was a bit dismayed to discover there is absolutely nothing in it about email and notifications and how to extend this. For me and many others I'm sure, email notification is a critical issue.  I have spent forever trawling Google and found nothing about this. Some help would be really appreciated.

thanks

Gus

"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
New Post
3/2/2011 7:11 PM
 
you can't extend the list unless in a derived subclass. I suggest localizing the message yourself before calling sendmail.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/4/2011 5:44 AM
 
Hi Sebastian

thanks for the reply, I think it now looks likely that I won't need to localize the message after all which should make life easier. However, as much as anything I'd like to know how to extend the core notification templates because it also provides a place where a msg template can be edited by admin
as opposed to buried in code in a DLL somewhere.

Can you explain how to use a derived subclass to do this?  My programming at this level is poor but I would like to learn.
I guess that a derived sub class is just a 'child' class that inherits from the super class. Something like:

public class MySendMail extends DNNCoreSendMail { 

This sub class then adds its own method(s) which provides the function of sending a different mail notification template.

How would I do this?  Can you provide any examples or point me in the right direction?

thanks
Gus


"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting Startedcreate a batch job to send localised email notificationscreate a batch job to send localised email notifications


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