Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Sending notification on unmoderated message board View modes: 
User avatar
Member
Member
dantahoua-gmail - 2/21/2012 12:59:37 PM
   
Sending notification on unmoderated message board
Hello!
Is there a way to receive a notification email when a new message is posted on a non-moderated message board? Maybe with EventHandler? I need some enlightment... Thanks

User avatar
Kentico Support
Kentico Support
kentico_radekm - 2/28/2012 2:43:25 AM
   
RE:Sending notification on unmoderated message board
Hello.

You can try to send e-mail via API in "msgEdit_OnAfterMessageSaved" event in ~\CMSModules\MessageBoards\Controls\MessageBoard.ascx.cs file.

E-mail message can be sent via following example code:

CMS.EmailEngine.EmailMessage msg = new CMS.EmailEngine.EmailMessage();

msg.From = "mymail@domain.com"; // use valid e-mail

msg.Recipients = "mymail@domain.com"; // use valid e-mail

msg.Subject = "Custom BizFrom e-mail";

msg.Body = "The value of the FirstName field: "

+ CMS.GlobalHelper.ValidationHelper.GetString(

this.viewBiz.BasicForm.DataRow["FirstName"], "N/A");

CMS.EmailEngine.EmailSender.SendEmail(msg);


Best Regards,
Radek Macalik