Click here to Skip to main content
15,895,746 members
Articles / Web Development / IIS

Email Notification Framework

Rate me:
Please Sign up or sign in to vote.
4.05/5 (9 votes)
4 Oct 2009CPOL7 min read 69K   1.2K   62  
A .NET managed framework to send template emails in HTML or plain text
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Frameworks.Notification.Core
{
    public class BusinessNotificationAdapter
    {


        public void SendSampleNotification(string from, string subjectPlaceholde1, string subjectPlaceholder2,
            string bodyPlaceholder1, string bodyPlaceholder2, IList<string> toList)
        {
            List<KeyValuePair<string, string>> placeholdersDataForBody = new List<KeyValuePair<string, string>>();
            placeholdersDataForBody.Add(new KeyValuePair<string, string>("@Placeholder1", bodyPlaceholder1));
            placeholdersDataForBody.Add(new KeyValuePair<string, string>("@Placeholder2", bodyPlaceholder2));

            List<KeyValuePair<string, string>> placeholdersDataForSubject = new List<KeyValuePair<string, string>>();
            placeholdersDataForSubject.Add(new KeyValuePair<string, string>("@Placeholder1", subjectPlaceholde1));
            placeholdersDataForSubject.Add(new KeyValuePair<string, string>("@Placeholder2", subjectPlaceholder2));
            //hard coding for now, we can use factroy if desired
            AbstractNotificationController notificationController = new ResxNotificationController.ResxNotificationController();
            notificationController.PrepareAndSendEmail(NotificaionType.SampleNotification, placeholdersDataForBody
                , placeholdersDataForSubject, toList, null, null, from, null);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Imfinity
India India
Hi I have been working on enterprise applications for last six years.

Comments and Discussions