Git Repository Public Repository

CPE_learningsite

URLs

Copy to Clipboard

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 4cd176 ... vs d90493 ... for CPE/CPE.App/CPE.App.Api/Helpers/SendEmailHelper.cs

Diff revisions: vs.
  @@ -1,9 +1,5 @@
1 1 using System;
2 - using System.Collections.Generic;
3 2 using System.Configuration;
4 - using System.Linq;
5 - using System.Web;
6 - using System.IO;
7 3 using CPE.App.Web.Models;
8 4 using System.Net.Mail;
9 5 using CPE.App.Api.Models;
  @@ -15,9 +11,16 @@
15 11 {
16 12 public static bool SendCertificateEmail(PurchasedCourse course)
17 13 {
14 + var courseEmail = course.Email;
15 + var emailTest = ConfigurationManager.AppSettings["EmailTest"];
16 + if (!string.IsNullOrWhiteSpace(emailTest))
17 + {
18 + courseEmail = emailTest;
19 + }
20 +
18 21 //elucidat cert email
19 22 var cDate = course.CertificateDate.Value.ToString("yyyyMMdd");
20 - MailMessage mail = new MailMessage(ConfigurationManager.AppSettings["EmailSender"], course.Email);
23 + MailMessage mail = new MailMessage(ConfigurationManager.AppSettings["EmailSender"], courseEmail);
21 24 SmtpClient client = new SmtpClient();
22 25 client.Port = 25;
23 26 client.DeliveryMethod = SmtpDeliveryMethod.Network;