Hey Luke,
I did the changes and updated the orderpipeline.dll in Install/OrderPipeLine folder. I also restarted the ComOrderPipeline Service. The site stopped sending order confirmation emails. The order status was straight going to Order Delayed- Under Review. Not sure what the problem is.
Here are the changes that i did
public static void SendOrderEmail(string host, Order order, IConfigurationSource cfgSrc, string emailTemplate) {
SiteConfigurationSection siteSection = (SiteConfigurationSection)cfgSrc.GetSection(SiteConfigurationSection.SectionName);
StoreConfigurationSection storeSection = (StoreConfigurationSection)cfgSrc.GetSection(StoreConfigurationSection.SectionName);
NameValueCollection tokens = CoreHelper.GetSiteTokens(siteSection);
order.AddTokens(siteSection, tokens);
List<string> bcc = new List<string>();
bcc.Add(siteSection.SiteEmailAddress);
newCustomerSource CS = new newCustomerSource();
string salesRepID = CS.getSalesRepIDFromIntID(order.UserId);
User salesRep = User.GetUser(salesRepID);
bcc.Add(salesRep.Email);
foreach (NamedConfigurationElement ccAddress in storeSection.OrderConfirmationEmailAddresses) {
bcc.Add(ccAddress.Name);
}
EmailManager.Send(host, emailTemplate, tokens, siteSection.SiteEmailAddress, new string[] { order.Email }, bcc);
}
Here is the function that returns the SalesRep ID
public string getSalesRepIDFromIntID(int userID)
{
string salesRepID = "";
newCustomerDataSourceDataContext db = new newCustomerDataSourceDataContext(ConfigurationController.SiteConfigurationController.GetSiteConnectionString(SiteNavigation.GetHost()));
var sRID = from d in db.DSC_Users
where d.userId == userID
select d;
foreach (var x in sRID)
{
salesRepID = x.salesRep;
}
return salesRepID;
}
Thanks
|