本文整理汇总了C#中Order.AddEmailQueue方法的典型用法代码示例。如果您正苦于以下问题:C# Order.AddEmailQueue方法的具体用法?C# Order.AddEmailQueue怎么用?C# Order.AddEmailQueue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.AddEmailQueue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderAddAttachment
public void OrderAddAttachment(Order order, User actor)
{
var users = order.OrderTrackings.Select(a => a.User).Distinct().ToList();
foreach (var ot in users)
{
if (!ot.IsActive) //Not active, we don't want to email them
{
continue;
}
var preference = GetEmailPreferences(ot.Id);
if (preference.AddAttachment)
{
//var emailQueue = new EmailQueue(order, preference.NotificationType, string.Format(AddAttachmentMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name, actor.FullName), ot);
var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Attachment Added", string.Format("By {0}.", actor.FullName), ot);
order.AddEmailQueue(emailQueue2);
}
}
}
示例2: AddQueuesToOrder
/// <summary>
/// Copy emailqueues into the order
/// </summary>
/// <param name="order"></param>
/// <param name="emailQueues"></param>
private void AddQueuesToOrder(Order order, List<EmailQueueV2> emailQueues )
{
foreach (var eq in emailQueues)
{
order.AddEmailQueue(eq);
}
}
示例3: OrderCancelled
public void OrderCancelled(Order order, User actor, string cancelReason, OrderStatusCode previousStatus)
{
var user = order.CreatedBy;
var preference = _emailPreferenceRepository.GetNullableById(user.Id);
var notificationType = EmailPreferences.NotificationTypes.PerEvent;
if (preference != null) { notificationType = preference.NotificationType; }
//var emailQueue = new EmailQueue(order, notificationType, string.Format(CancellationMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name, actor.FullName, order.StatusCode.Name, cancelReason), user);
var emailQueue2 = new EmailQueueV2(order, notificationType, "Cancelled", string.Format("By {0} at {1} review with the comment \"{2}\".", actor.FullName, previousStatus.Name, cancelReason), user);
order.AddEmailQueue(emailQueue2);
}
示例4: OrderCreated
/// <summary>
/// Tested Feb 17, 2012
/// </summary>
/// <param name="order"></param>
public void OrderCreated(Order order)
{
var user = order.CreatedBy;
var preference = GetEmailPreferences(user.Id);
if(preference.RequesterOrderSubmission)
{
//var emailQueue = new EmailQueue(order, preference.NotificationType, string.Format(SubmissionMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name), user);
var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Submitted", null, user);
order.AddEmailQueue(emailQueue2);
}
// add the approvers/account managers that are "next" to see if they want the "arrival" email
// get the lowest level
var level = order.Approvals.Where(a => !a.Completed).Min(a => a.StatusCode.Level);
ProcessArrival(order, null, level);
}
示例5: OrderAddNote
public void OrderAddNote(Order order, User actor, string comment)
{
var users = order.OrderTrackings.Select(a => a.User).Distinct().ToList();
var shortComment = comment ?? string.Empty;
if (comment != null && comment.Length > 100)
{
shortComment = comment.Substring(0, 100) + "...";
}
foreach (var ot in users)
{
if (!ot.IsActive) //Not active, we don't want to email them
{
continue;
}
var preference = GetEmailPreferences(ot.Id);
if (preference.AddNote)
{
//var emailQueue = new EmailQueue(order, preference.NotificationType, string.Format(AddNoteMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name, actor.FullName), ot);
var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Note Added", string.Format("By {0} with the note \"{1}\".", actor.FullName, shortComment), ot);
order.AddEmailQueue(emailQueue2);
}
}
}