public static BaseReply InvokeEM7NewsletterConfirmation(InvokeEM7NewsletterConfirmationRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
			int emailTemplateID = GetEmailTemplateId(preferredLanguage, Constants.EmailIDs.EM7NewsletterConfirmationENID, Constants.EmailIDs.EM7NewsletterConfirmationSPID);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "Newsletter Confirmation");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;

                        etAPI.Attribute tempAttribute;
                        List<etAPI.Attribute> AttributeList = new List<etAPI.Attribute>();

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "week_day";
                        tempAttribute.Value = request.WeekDay;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "confirm_subscription_link";
                        tempAttribute.Value = request.WeekDay;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "domain_link";
                        tempAttribute.Value = request.RequestUrl.Scheme + "://" + request.RequestUrl.Authority;
                        AttributeList.Add(tempAttribute);

                        newSub.Attributes = AttributeList.ToArray();
                       

						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send welcome email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}
        public static BaseReply SendBehaviorToolSuggestion(BaseRequest request, string message)
        {
            BaseReply reply = new BaseReply();

            SoapClient client = ExactTargetService.GetInstance();

            StringBuilder sbReturnString = new StringBuilder();

            Guid preferredLanguage = request.PreferredLanguage;
            int emailTemplateID = Constants.EmailIDs.BehaviorToolSuggestion;

            try
            {
                //Create a GUID for ESD to ensure a unique name and customer key
                TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "Parent Toolkit");

                string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

                if (cStatus == "OK")
                {
                    tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
                    tsd.TriggeredSendStatusSpecified = true; //required

                    string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

                    if (uStatus == "OK")
                    {
                        // *** SEND THE TRIGGER EMAIL
                        Subscriber sub = new Subscriber
                        {
                            EmailAddress = request.ToEmail,
                            SubscriberKey = request.ToEmail,
                        };

                        sub.Attributes = new etAPI.Attribute[]
                        {
                            new etAPI.Attribute
                            {
                                Name = "HTML_CONTENT",
                                Value = message   
                            }
                        };

                        ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, sub);

                        reply.Successful = true;
                    }
                }
            }
            catch (Exception ex)
            {
                reply.Successful = false;
                reply.Message = "Unable to send Behavior Suggestion email."; ;

                Log.Error("Error sending behavior suggestion", ex);
            }

            return reply;
        }
		}//This email will be sent from Convio/Luminate.
		//public static BaseReply InvokeEM5KeepingAllStudentsSafe(InvokeEM5KeepingAllStudentsSafeRequest request)
		//{
		//	BaseReply reply = new BaseReply();

		//	SoapClient client = ExactTargetService.GetInstance();

		//	StringBuilder sbReturnString = new StringBuilder();

		//	try
		//	{
		//		//Create a GUID for ESD to ensure a unique name and customer key
		//		TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), 518, request.ToEmail, "Keeping all Students Safe");

		//		string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

		//		if (cStatus == "OK")
		//		{
		//			tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
		//			tsd.TriggeredSendStatusSpecified = true; //required

		//			string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

		//			if (uStatus == "OK")
		//			{
		//				// *** SEND THE TRIGGER EMAIL
		//				Subscriber newSub = new Subscriber();
		//				newSub.EmailAddress = request.ToEmail;
		//				newSub.SubscriberKey = request.ToEmail;

		//				ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

		//				reply.Successful = true;
		//			}
		//		}
		//	}
		//	catch (Exception exc)
		//	{
		//		string message = "Unable to send welcome email.";

		//		reply.Successful = false;
		//		reply.Message = message;

		//		Log.Error(exc.ToString(), "something went wrong");
		//	}

		//	return reply;
		//}//This email will be sent from Convio/Luminate.
		public static BaseReply InvokeEM6HolidayDonations(InvokeEM6HolidayDonationsRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
			int emailTemplateID = GetEmailTemplateId(preferredLanguage, Constants.EmailIDs.EM6HolidayDonationsENID, Constants.EmailIDs.EM6HolidayDonationsSPID);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "Holiday Donations Request");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;

						newSub.Attributes = new etAPI.Attribute[1];
						newSub.Attributes[0] = new etAPI.Attribute();
						newSub.Attributes[0].Name = "fullname";
						newSub.Attributes[0].Value = request.FullName;

						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send welcome email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}
		public static BaseReply InvokeE1B2TurnAroundBullying(InvokeE1B2TurnAroundBullyingRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
            int emailTemplateID = GetEmailTemplateId(preferredLanguage, 335, 0);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "e1c newsletter (joined 2 groups)");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;



						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send welcome email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}
		public static BaseReply InvokeE1ATurnAroundBullying(InvokeE1ATurnAroundBullyingRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
            int emailTemplateID = GetEmailTemplateId(preferredLanguage, 1070, 0);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "Newsletter 1");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required
					tsd.Priority = "High";

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;

                        newSub.Attributes = new etAPI.Attribute[]
                        {
                            new etAPI.Attribute
                            {
                                Name = "personalized_recommended_articles",
                                Value = GetChildPersonalizedArticles(request.Child)    
                            }
                        };

						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send e1a email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}
		public static BaseReply InvokeEM14ThisWeeksActivity(InvokeEM14ThisWeeksActivityRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
			int emailTemplateID = GetEmailTemplateId(preferredLanguage, Constants.EmailIDs.EM14ActivityFromThisWeekENID, Constants.EmailIDs.EM14ActivityFromThisWeekSPID);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "Weekly Digest");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;

						newSub.Attributes = new etAPI.Attribute[11];
						newSub.Attributes[0] = new etAPI.Attribute();
						newSub.Attributes[0].Name = "activity_from_this_week_module";
						newSub.Attributes[0].Value = request.ActivityFromThisWeekModule;

						newSub.Attributes[1] = new etAPI.Attribute();
						newSub.Attributes[1].Name = "contact_settings_link";
						newSub.Attributes[1].Value = request.ContactSettingsLink;

						newSub.Attributes[2] = new etAPI.Attribute();
						newSub.Attributes[2].Name = "profile_image_link";
						newSub.Attributes[2].Value = request.ProfileImageLink;

						newSub.Attributes[3] = new etAPI.Attribute();
						newSub.Attributes[3].Name = "user_profile_link";
						newSub.Attributes[3].Value = request.UserProfileLink;

						newSub.Attributes[4] = new etAPI.Attribute();
						newSub.Attributes[4].Name = "view_messages_link";
						newSub.Attributes[4].Value = request.ViewMessageLink;

						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send welcome email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}
		public static BaseReply InvokeEM28AppsTechnologySharedWithAFriend(InvokeEM28AppsTechnologySharedWithAFriendRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
			int emailTemplateID = GetEmailTemplateId(preferredLanguage, Constants.EmailIDs.EM28AppsTechnologySharedWithAFriendENID, Constants.EmailIDs.EM28AppsTechnologySharedWithAFriendSPID);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "apps technology shared with friend");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;



                        etAPI.Attribute tempAttribute;
                        List<etAPI.Attribute> AttributeList = new List<etAPI.Attribute>();

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "domain_link";
                        tempAttribute.Value = request.RequestUrl.Scheme + "://" + request.RequestUrl.Authority;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_description";
                        tempAttribute.Value = request.AppDescription;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_good_for";
                        tempAttribute.Value = request.AppGoodFor;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_grade";
                        tempAttribute.Value = request.AppGrade;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_learning_link";
                        tempAttribute.Value = request.AppLearningLink;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_link";
                        tempAttribute.Value = request.AppLink;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_logo";
                        tempAttribute.Value = request.AppLogo;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_quality";
                        tempAttribute.Value = request.AppQuality;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_rating_link";
                        tempAttribute.Value = request.AppRatingLink;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_rating_module";
                        tempAttribute.Value = request.AppRatingModule;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "app_title";
                        tempAttribute.Value = request.AppTitle;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "user_contact_first_name";
                        tempAttribute.Value = request.UserContactFirstName;
                        AttributeList.Add(tempAttribute);



                        newSub.Attributes = AttributeList.ToArray();




						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send welcome email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}
		public static BaseReply InvokeEM24ContentSharedWithAFriend(InvokeEM24ContentSharedWithAFriendRequest request)
		{
			BaseReply reply = new BaseReply();

			SoapClient client = ExactTargetService.GetInstance();

			StringBuilder sbReturnString = new StringBuilder();

			Guid preferredLanguage = request.PreferredLanguage;
			int emailTemplateID = GetEmailTemplateId(preferredLanguage, Constants.EmailIDs.EM24ContentSharedWithAFriendENID, Constants.EmailIDs.EM24ContentSharedWithAFriendSPID);

			try
			{
				//Create a GUID for ESD to ensure a unique name and customer key
				TriggeredSendDefinition tsd = ExactTargetService.GetSendDefinition(Guid.NewGuid().ToString(), emailTemplateID, request.ToEmail, "content shared with a friend");

				string cStatus = ExactTargetService.GetCreateResult(ref client, tsd, ref sbReturnString);

				if (cStatus == "OK")
				{
					tsd.TriggeredSendStatus = TriggeredSendStatusEnum.Active; //necessary to set the TriggeredSendDefinition to "Running"
					tsd.TriggeredSendStatusSpecified = true; //required

					string uStatus = ExactTargetService.GetUpdateResult(ref client, tsd, ref sbReturnString);

					if (uStatus == "OK")
					{
						// *** SEND THE TRIGGER EMAIL
						Subscriber newSub = new Subscriber();
						newSub.EmailAddress = request.ToEmail;
						newSub.SubscriberKey = request.ToEmail;

                        etAPI.Attribute tempAttribute;
                        List<etAPI.Attribute> AttributeList = new List<etAPI.Attribute>();

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "domain_link";
                        tempAttribute.Value = request.RequestUrl.Scheme + "://" + request.RequestUrl.Authority;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "content_helpfulness_and_comments_module";
                        tempAttribute.Value = request.ContentHelpfulnessAndCommentsModule;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "pm_text";
                        tempAttribute.Value = request.PMText;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "reminder_image";
                        tempAttribute.Value = request.ReminderImage;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "reminder_link";
                        tempAttribute.Value = request.ReminderLink;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "reminder_summary";
                        tempAttribute.Value = request.ReminderSummary;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "reminder_title";
                        tempAttribute.Value = request.ReminderTitle;
                        AttributeList.Add(tempAttribute);

                        tempAttribute = new etAPI.Attribute();
                        tempAttribute.Name = "user_contact_first_name";
                        tempAttribute.Value = request.UserContactFirstName;
                        AttributeList.Add(tempAttribute);

                        newSub.Attributes = AttributeList.ToArray();



						ExactTargetService.SendEmail(ref client, tsd, ref sbReturnString, newSub);

						reply.Successful = true;
					}
				}
			}
			catch (Exception exc)
			{
				string message = "Unable to send welcome email.";

				reply.Successful = false;
				reply.Message = message;

				Log.Error(exc.ToString(), "something went wrong");
			}

			return reply;
		}