diff --git a/docs/virtual-assistant/gettingstarted.md b/docs/virtual-assistant/gettingstarted.md
index ea36b56d70..131bbf641a 100644
--- a/docs/virtual-assistant/gettingstarted.md
+++ b/docs/virtual-assistant/gettingstarted.md
@@ -200,7 +200,7 @@ The [Add Authentication to your bot](https://docs.microsoft.com/en-us/azure/bot-
- `Notes.ReadWrite`
- `People.Read`
- `Tasks.ReadWrite`
- - `User.Read`
+ - `User.ReadBasic.All`
- Click Add Permissions at the bottom to apply the changes.
Next you need to create the Authentication Connection for your Bot. Ensure you use the same combination of Scopes that you provided in the above command. The first command shown below will retrieve the appId (ApplicationId) and appPassword (Client Secret) that you need to complete this step.
@@ -210,7 +210,7 @@ The commands shown below assume you have used the deployment process and your re
```shell
msbot get production --secret YOUR_SECRET
-az bot authsetting create --resource-group YOUR_BOT_NAME --name YOUR_BOT_NAME --setting-name "YOUR_AUTH_CONNECTION_DISPLAY_NAME" --client-id "YOUR_APPLICATION_ID" --client-secret "YOUR_APPLICATION_PASSWORD" --service Aadv2 --parameters clientId="YOUR_APPLICATION_ID" clientSecret="YOUR_APPLICATION_PASSWORD" tenantId=common --provider-scope-string "Calendars.ReadWrite Mail.ReadWrite Mail.Send Tasks.ReadWrite Notes.ReadWrite People.Read User.Read Contacts.Read"
+az bot authsetting create --resource-group YOUR_BOT_NAME --name YOUR_BOT_NAME --setting-name "YOUR_AUTH_CONNECTION_DISPLAY_NAME" --client-id "YOUR_APPLICATION_ID" --client-secret "YOUR_APPLICATION_PASSWORD" --service Aadv2 --parameters clientId="YOUR_APPLICATION_ID" clientSecret="YOUR_APPLICATION_PASSWORD" tenantId=common --provider-scope-string "Calendars.ReadWrite Mail.ReadWrite Mail.Send Tasks.ReadWrite Notes.ReadWrite People.Read User.ReadBasic.All Contacts.Read"
```
> NOTE: Take special care when running the `authsetting` commands to correctly escape special characters in your client secret key (or parameters that contain special characters).
diff --git a/solutions/Virtual-Assistant/src/csharp/assistant/VirtualAssistant.csproj b/solutions/Virtual-Assistant/src/csharp/assistant/VirtualAssistant.csproj
index f044e26fb9..688b6033de 100644
--- a/solutions/Virtual-Assistant/src/csharp/assistant/VirtualAssistant.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/assistant/VirtualAssistant.csproj
@@ -49,7 +49,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/experimental/skills/newsskill/NewsSkill.csproj b/solutions/Virtual-Assistant/src/csharp/experimental/skills/newsskill/NewsSkill.csproj
index 696611e247..36364389e9 100644
--- a/solutions/Virtual-Assistant/src/csharp/experimental/skills/newsskill/NewsSkill.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/experimental/skills/newsskill/NewsSkill.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/experimental/skills/restaurantbooking/RestaurantBooking.csproj b/solutions/Virtual-Assistant/src/csharp/experimental/skills/restaurantbooking/RestaurantBooking.csproj
index fa0062820e..5ed1cf4433 100644
--- a/solutions/Virtual-Assistant/src/csharp/experimental/skills/restaurantbooking/RestaurantBooking.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/experimental/skills/restaurantbooking/RestaurantBooking.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskill/AutomotiveSkill.csproj b/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskill/AutomotiveSkill.csproj
index 49b2c54dd0..3b10a411ba 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskill/AutomotiveSkill.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskill/AutomotiveSkill.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskilltest/AutomotiveSkillTest.csproj b/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskilltest/AutomotiveSkillTest.csproj
index 028afd61ad..f60e8059bb 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskilltest/AutomotiveSkillTest.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/automotiveskill/automotiveskilltest/AutomotiveSkillTest.csproj
@@ -14,7 +14,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/CalendarSkill.csproj b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/CalendarSkill.csproj
index 0806bd4f55..58bf8819a9 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/CalendarSkill.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/CalendarSkill.csproj
@@ -24,7 +24,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/ChangeEventStatus/ChangeEventStatusDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/ChangeEventStatus/ChangeEventStatusDialog.cs
index 4f290cec4a..4eeca39dd5 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/ChangeEventStatus/ChangeEventStatusDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/ChangeEventStatus/ChangeEventStatusDialog.cs
@@ -82,7 +82,7 @@ public ChangeEventStatusDialog(
}
var card = new Card(deleteEvent.OnlineMeetingUrl == null ? "CalendarCardNoJoinButton" : "CalendarCard", deleteEvent.ToAdaptiveCardData(state.GetUserTimeZone()));
- var replyMessage = ResponseManager.GetCardResponse(replyResponse, card);
+ var replyMessage = ResponseManager.GetCardResponse(replyResponse, card, tokens: null);
var retryMessage = ResponseManager.GetResponse(retryResponse);
return await sc.PromptAsync(Actions.TakeFurtherAction, new PromptOptions
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs
index 6883ca8bb2..145b9bb110 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/Dialogs/UpdateEvent/UpdateEventDialog.cs
@@ -116,7 +116,8 @@ public UpdateEventDialog(
{
Name = origin.OnlineMeetingUrl == null ? "CalendarCardNoJoinButton" : "CalendarCard",
Data = origin.ToAdaptiveCardData(state.GetUserTimeZone())
- });
+ },
+ tokens: null);
return await sc.PromptAsync(Actions.TakeFurtherAction, new PromptOptions
{
@@ -162,7 +163,8 @@ public UpdateEventDialog(
{
Name = newEvent.OnlineMeetingUrl == null ? "CalendarCardNoJoinButton" : "CalendarCard",
Data = newEvent.ToAdaptiveCardData(state.GetUserTimeZone())
- });
+ },
+ tokens: null);
await sc.Context.SendActivityAsync(replyMessage);
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/ServiceClients/GoogleAPI/GooglePeopleService.cs b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/ServiceClients/GoogleAPI/GooglePeopleService.cs
index 5984478bd4..2f22b393dc 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/ServiceClients/GoogleAPI/GooglePeopleService.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskill/ServiceClients/GoogleAPI/GooglePeopleService.cs
@@ -101,7 +101,7 @@ public async Task GetMe()
{
throw GoogleClient.HandleGoogleAPIException(ex);
}
-}
+ }
// get people work with
private async Task> GetGooglePeopleAsync(string name)
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskilltest/CalendarSkillTest.csproj b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskilltest/CalendarSkillTest.csproj
index e96977f361..a843ce0313 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskilltest/CalendarSkillTest.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/calendarskill/calendarskilltest/CalendarSkillTest.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/DeleteEmail/DeleteEmailDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/DeleteEmail/DeleteEmailDialog.cs
index ebb42035fc..19aa20d6c9 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/DeleteEmail/DeleteEmailDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/DeleteEmail/DeleteEmailDialog.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;
@@ -9,10 +10,12 @@
using EmailSkill.Dialogs.Shared.Resources;
using EmailSkill.Dialogs.Shared.Resources.Cards;
using EmailSkill.Dialogs.Shared.Resources.Strings;
+using EmailSkill.Extensions;
using EmailSkill.ServiceClients;
using EmailSkill.Util;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
+using Microsoft.Bot.Builder.Solutions.Resources;
using Microsoft.Bot.Builder.Solutions.Responses;
using Microsoft.Bot.Builder.Solutions.Skills;
using Microsoft.Bot.Builder.Solutions.Util;
@@ -71,27 +74,38 @@ public DeleteEmailDialog(
var state = await EmailStateAccessor.GetAsync(sc.Context);
var skillOptions = (EmailSkillDialogOptions)sc.Options;
- var focusedMessage = state.Message?.FirstOrDefault();
- if (focusedMessage != null)
+ var message = state.Message?.FirstOrDefault();
+ if (message != null)
{
- var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(focusedMessage.ToRecipients);
+ var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(message.ToRecipients);
+ var senderIcon = await GetUserPhotoUrlAsync(sc.Context, message.Sender.EmailAddress);
var emailCard = new EmailCardData
{
- Subject = string.Format(EmailCommonStrings.SubjectFormat, focusedMessage.Subject),
- NameList = string.Format(EmailCommonStrings.ToFormat, nameListString),
- EmailContent = string.Format(EmailCommonStrings.ContentFormat, focusedMessage.BodyPreview),
+ Subject = message.Subject,
+ EmailContent = message.BodyPreview,
+ Sender = message.Sender.EmailAddress.Name,
+ EmailLink = message.WebLink,
+ ReceivedDateTime = message?.ReceivedDateTime == null
+ ? CommonStrings.NotAvailable
+ : message.ReceivedDateTime.Value.UtcDateTime.ToDetailRelativeString(state.GetUserTimeZone()),
+ Speak = SpeakHelper.ToSpeechEmailDetailOverallString(message, state.GetUserTimeZone()),
+ SenderIcon = senderIcon
};
+ emailCard = await ProcessRecipientPhotoUrl(sc.Context, emailCard, message.ToRecipients);
- var speech = SpeakHelper.ToSpeechEmailSendDetailString(focusedMessage.Subject, nameListString, focusedMessage.BodyPreview);
+ var speech = SpeakHelper.ToSpeechEmailSendDetailString(message.Subject, nameListString, message.BodyPreview);
var tokens = new StringDictionary
{
{ "EmailDetails", speech },
};
+ var recipientCard = message.ToRecipients.Count() > 5 ? "DetailCard_RecipientMoreThanFive" : "DetailCard_RecipientLessThanFive";
var prompt = ResponseManager.GetCardResponse(
DeleteEmailResponses.DeleteConfirm,
- new Card("EmailWithOutButtonCard", emailCard),
- tokens);
+ new Card("EmailDetailCard", emailCard),
+ tokens,
+ "items",
+ new List().Append(new Card(recipientCard, emailCard)));
var retry = ResponseManager.GetResponse(EmailSharedResponses.ConfirmSendFailed);
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/FindContact/FindContactDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/FindContact/FindContactDialog.cs
index 0f33d196a6..b453aef118 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/FindContact/FindContactDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/FindContact/FindContactDialog.cs
@@ -8,6 +8,7 @@
using EmailSkill.Dialogs.Shared;
using EmailSkill.Dialogs.Shared.DialogOptions;
using EmailSkill.Dialogs.Shared.Resources;
+using EmailSkill.Model;
using EmailSkill.ServiceClients;
using EmailSkill.Util;
using Luis;
@@ -144,7 +145,7 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
return await sc.EndDialogAsync();
}
- if (IsEmail(userInput))
+ if (Util.Util.IsEmail(userInput))
{
if (!state.EmailList.Contains(userInput))
{
@@ -183,7 +184,7 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
return await sc.BeginDialogAsync(Actions.UpdateRecipientName, new UpdateUserDialogOptions(UpdateUserDialogOptions.UpdateReason.NotFound));
}
- var unionList = new List();
+ var unionList = new List();
if (state.FirstEnterFindContact || state.EmailList.Count > 0)
{
@@ -229,14 +230,16 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
{
var currentRecipientName = state.NameList[state.ConfirmRecipientIndex];
- var originPersonList = await GetPeopleWorkWithAsync(sc.Context, currentRecipientName);
- var originContactList = await GetContactsAsync(sc.Context, currentRecipientName);
+ var token = state.Token;
+ var service = ServiceManager.InitUserService(token, state.GetUserTimeZone(), state.MailSourceType);
+ var originPersonList = await service.GetPeopleAsync(currentRecipientName);
+ var originContactList = await service.GetContactsAsync(currentRecipientName);
originPersonList.AddRange(originContactList);
- var originUserList = new List();
+ var originUserList = new List();
try
{
- originUserList = await GetUserAsync(sc.Context, currentRecipientName);
+ originUserList = await service.GetUserAsync(currentRecipientName);
}
catch
{
@@ -246,7 +249,7 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
(var personList, var userList) = DisplayHelper.FormatRecipientList(originPersonList, originUserList);
// people you work with has the distinct email address has the highest priority
- if (personList.Count == 1 && personList.First().ScoredEmailAddresses.Count() == 1 && personList.First().ScoredEmailAddresses != null && !string.IsNullOrEmpty(personList.First().ScoredEmailAddresses.First().Address))
+ if (personList.Count == 1 && personList.First().Emails != null && personList.First().Emails?.Count() == 1 && !string.IsNullOrEmpty(personList.First().Emails.First()))
{
state.ConfirmedPerson = personList.First();
return await sc.ReplaceDialogAsync(Actions.ConfirmEmail, personList.First());
@@ -266,19 +269,19 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
else
{
var unionPerson = personWithSameName.FirstOrDefault();
- var emailList = new List();
+ var emailList = new List();
foreach (var sameNamePerson in personWithSameName)
{
- sameNamePerson.ScoredEmailAddresses.ToList().ForEach(e =>
+ foreach (var email in sameNamePerson.Emails)
{
- if (e != null && !string.IsNullOrEmpty(e.Address))
+ if (!string.IsNullOrEmpty(email))
{
- emailList.Add(e);
+ emailList.Add(email);
}
- });
+ }
}
- unionPerson.ScoredEmailAddresses = emailList;
+ unionPerson.Emails = emailList;
unionList.Add(unionPerson);
}
}
@@ -289,7 +292,8 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
return await sc.EndDialogAsync();
}
- unionList.RemoveAll(person => !person.ScoredEmailAddresses.ToList().Exists(email => email.Address != null));
+ unionList.RemoveAll(person => !person.Emails.Exists(email => email != null));
+ unionList.RemoveAll(person => !person.Emails.Any());
state.UnconfirmedPerson = unionList;
@@ -410,17 +414,17 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
public async Task ConfirmEmail(WaterfallStepContext sc, CancellationToken cancellationToken = default(CancellationToken))
{
var state = await EmailStateAccessor.GetAsync(sc.Context);
- var confirmedPerson = sc.Options as Person;
+ var confirmedPerson = sc.Options as PersonModel;
var name = confirmedPerson.DisplayName;
- if (confirmedPerson.ScoredEmailAddresses.Count() == 1)
+ if (confirmedPerson.Emails.Count == 1)
{
// Highest probability
- return await sc.PromptAsync(Actions.TakeFurtherAction, new PromptOptions { Prompt = ResponseManager.GetResponse(FindContactResponses.PromptOneNameOneAddress, new StringDictionary() { { "UserName", name }, { "EmailAddress", confirmedPerson.ScoredEmailAddresses.First().Address } }), });
+ return await sc.PromptAsync(Actions.TakeFurtherAction, new PromptOptions { Prompt = ResponseManager.GetResponse(FindContactResponses.PromptOneNameOneAddress, new StringDictionary() { { "UserName", name }, { "EmailAddress", confirmedPerson.Emails.First() } }), });
}
else
{
var emailString = string.Empty;
- var emailList = confirmedPerson.ScoredEmailAddresses.ToList();
+ var emailList = confirmedPerson.Emails;
if (emailList.Count <= ConfigData.GetInstance().MaxDisplaySize)
{
@@ -448,7 +452,7 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
var emailAddress = new EmailAddress
{
Name = name,
- Address = confirmedPerson.ScoredEmailAddresses.First().Address
+ Address = confirmedPerson.Emails.First()
};
recipient.EmailAddress = emailAddress;
if (state.Recipients.All(r => r.EmailAddress.Address != emailAddress.Address))
@@ -543,7 +547,7 @@ await sc.Context.SendActivityAsync(ResponseManager.GetResponse(
// Clean up data
state.ShowRecipientIndex = 0;
state.ReadRecipientIndex = 0;
- state.ConfirmedPerson = new Person();
+ state.ConfirmedPerson = new PersonModel();
state.RecipientChoiceList.Clear();
}
}
@@ -605,13 +609,13 @@ private async Task GetReadyToSendNameListStringAsync(WaterfallStepContex
return nameString;
}
- private async Task GenerateOptionsForEmail(WaterfallStepContext sc, Person confirmedPerson, ITurnContext context, bool isSinglePage = true)
+ private async Task GenerateOptionsForEmail(WaterfallStepContext sc, PersonModel confirmedPerson, ITurnContext context, bool isSinglePage = true)
{
var state = await EmailStateAccessor.GetAsync(context);
var pageIndex = state.ShowRecipientIndex;
var pageSize = ConfigData.GetInstance().MaxDisplaySize;
var skip = pageSize * pageIndex;
- var emailList = confirmedPerson.ScoredEmailAddresses.ToList();
+ var emailList = confirmedPerson.Emails;
// Go back to the last page when reaching the end.
if (skip >= emailList.Count && pageIndex > 0)
@@ -637,7 +641,7 @@ private async Task GenerateOptionsForEmail(WaterfallStepContext s
for (var i = 0; i < emailList.Count; i++)
{
var user = confirmedPerson;
- var mailAddress = emailList[i].Address ?? user.UserPrincipalName;
+ var mailAddress = emailList[i] ?? user.UserPrincipalName;
var choice = new Choice()
{
@@ -693,7 +697,7 @@ private string GetSelectPromptEmailString(PromptOptions selectOption, bool conta
return result;
}
- private async Task GenerateOptionsForName(WaterfallStepContext sc, List unionList, ITurnContext context, bool isSinglePage = true)
+ private async Task GenerateOptionsForName(WaterfallStepContext sc, List unionList, ITurnContext context, bool isSinglePage = true)
{
var state = await EmailStateAccessor.GetAsync(context);
var pageIndex = state.ShowRecipientIndex;
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ForwardEmail/ForwardEmailDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ForwardEmail/ForwardEmailDialog.cs
index a302018f41..f39296c44e 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ForwardEmail/ForwardEmailDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ForwardEmail/ForwardEmailDialog.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;
@@ -94,24 +95,25 @@ public ForwardEmailDialog(
var content = state.Content.Equals(EmailCommonStrings.EmptyContent) ? string.Empty : state.Content;
await service.ForwardMessageAsync(id, content, recipients);
- var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(state.Recipients);
-
var emailCard = new EmailCardData
{
- Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : string.Format(EmailCommonStrings.SubjectFormat, state.Subject),
- NameList = string.Format(EmailCommonStrings.ToFormat, nameListString),
- EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : string.Format(EmailCommonStrings.ContentFormat, state.Content),
+ Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : state.Subject,
+ EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : state.Content,
};
+ emailCard = await ProcessRecipientPhotoUrl(sc.Context, emailCard, state.Recipients);
var stringToken = new StringDictionary
{
{ "Subject", state.Subject },
};
+ var recipientCard = state.Recipients.Count() > 5 ? "ConfirmCard_RecipientMoreThanFive" : "ConfirmCard_RecipientLessThanFive";
var reply = ResponseManager.GetCardResponse(
EmailSharedResponses.SentSuccessfully,
new Card("EmailWithOutButtonCard", emailCard),
- stringToken);
+ stringToken,
+ "items",
+ new List().Append(new Card(recipientCard, emailCard)));
await sc.Context.SendActivityAsync(reply);
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ReplyEmail/ReplyEmailDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ReplyEmail/ReplyEmailDialog.cs
index a4bfcef669..36e98750a0 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ReplyEmail/ReplyEmailDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ReplyEmail/ReplyEmailDialog.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;
@@ -85,24 +86,25 @@ public ReplyEmailDialog(
await service.ReplyToMessageAsync(message.Id, content);
}
- var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(message?.ToRecipients);
-
var emailCard = new EmailCardData
{
- Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : string.Format(EmailCommonStrings.SubjectFormat, state.Subject),
- NameList = string.Format(EmailCommonStrings.ToFormat, nameListString),
- EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : string.Format(EmailCommonStrings.ContentFormat, state.Content),
+ Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : state.Subject,
+ EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : state.Content,
};
+ emailCard = await ProcessRecipientPhotoUrl(sc.Context, emailCard, state.Recipients);
var stringToken = new StringDictionary
{
{ "Subject", state.Subject },
};
+ var recipientCard = state.Recipients.Count() > 5 ? "ConfirmCard_RecipientMoreThanFive" : "ConfirmCard_RecipientLessThanFive";
var reply = ResponseManager.GetCardResponse(
EmailSharedResponses.SentSuccessfully,
new Card("EmailWithOutButtonCard", emailCard),
- stringToken);
+ stringToken,
+ "items",
+ new List().Append(new Card(recipientCard, emailCard)));
await sc.Context.SendActivityAsync(reply);
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/SendEmail/SendEmailDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/SendEmail/SendEmailDialog.cs
index bdcccf0b7b..1cce3a082b 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/SendEmail/SendEmailDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/SendEmail/SendEmailDialog.cs
@@ -1,5 +1,7 @@
using System;
+using System.Collections.Generic;
using System.Collections.Specialized;
+using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EmailSkill.Dialogs.FindContact;
@@ -308,7 +310,8 @@ public SendEmailDialog(
var emailCard = new EmailCardData
{
- EmailContent = string.Format(EmailCommonStrings.ContentFormat, state.Content),
+ Subject = EmailCommonStrings.MessageConfirm,
+ EmailContent = state.Content,
};
var stringToken = new StringDictionary
@@ -385,23 +388,25 @@ public SendEmailDialog(
var content = state.Content.Equals(EmailCommonStrings.EmptyContent) ? string.Empty : state.Content;
await service.SendMessageAsync(content, subject, state.Recipients);
- var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(state.Recipients);
-
var emailCard = new EmailCardData
{
Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : string.Format(EmailCommonStrings.SubjectFormat, state.Subject),
- NameList = string.Format(EmailCommonStrings.ToFormat, nameListString),
EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : string.Format(EmailCommonStrings.ContentFormat, state.Content),
};
+ emailCard = await ProcessRecipientPhotoUrl(sc.Context, emailCard, state.Recipients);
var stringToken = new StringDictionary
{
{ "Subject", state.Subject },
};
+
+ var recipientCard = state.Recipients.Count() > 5 ? "ConfirmCard_RecipientMoreThanFive" : "ConfirmCard_RecipientLessThanFive";
var replyMessage = ResponseManager.GetCardResponse(
EmailSharedResponses.SentSuccessfully,
new Card("EmailWithOutButtonCard", emailCard),
- stringToken);
+ stringToken,
+ "items",
+ new List().Append(new Card(recipientCard, emailCard)));
await sc.Context.SendActivityAsync(replyMessage);
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/EmailSkillDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/EmailSkillDialog.cs
index 0c6a78efb7..ff5f46a00f 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/EmailSkillDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/EmailSkillDialog.cs
@@ -450,10 +450,10 @@ protected override Task EndComponentAsync(DialogContext outerD
var emailCard = new EmailCardData
{
- Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : string.Format(EmailCommonStrings.SubjectFormat, state.Subject),
- NameList = string.Format(EmailCommonStrings.ToFormat, nameListString),
- EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : string.Format(EmailCommonStrings.ContentFormat, state.Content),
+ Subject = state.Subject.Equals(EmailCommonStrings.EmptySubject) ? null : state.Subject,
+ EmailContent = state.Content.Equals(EmailCommonStrings.EmptyContent) ? null : state.Content,
};
+ emailCard = await ProcessRecipientPhotoUrl(sc.Context, emailCard, state.Recipients);
var speech = SpeakHelper.ToSpeechEmailSendDetailString(state.Subject, nameListString, state.Content);
var tokens = new StringDictionary
@@ -461,10 +461,13 @@ protected override Task EndComponentAsync(DialogContext outerD
{ "EmailDetails", speech },
};
+ var recipientCard = state.Recipients.Count() > 5 ? "ConfirmCard_RecipientMoreThanFive" : "ConfirmCard_RecipientLessThanFive";
var prompt = ResponseManager.GetCardResponse(
EmailSharedResponses.ConfirmSend,
new Card("EmailWithOutButtonCard", emailCard),
- tokens);
+ tokens,
+ "items",
+ new List().Append(new Card(recipientCard, emailCard)));
var retry = ResponseManager.GetResponse(EmailSharedResponses.ConfirmSendFailed);
@@ -576,7 +579,7 @@ protected override Task EndComponentAsync(DialogContext outerD
return await sc.BeginDialogAsync(Actions.CollectRecipient, skillOptions);
}
- if (IsEmail(userInput))
+ if (Util.Util.IsEmail(userInput))
{
state.EmailList.Add(userInput);
}
@@ -636,7 +639,7 @@ protected override Task EndComponentAsync(DialogContext outerD
{
var state = await EmailStateAccessor.GetAsync(sc.Context);
- var (messages, totalCount) = await GetMessagesAsync(sc);
+ var (messages, totalCount, importantCount) = await GetMessagesAsync(sc);
// Get display messages
var displayMessages = new List();
@@ -652,7 +655,7 @@ protected override Task EndComponentAsync(DialogContext outerD
state.Message.Clear();
state.Message.Add(displayMessages[0]);
- await ShowMailList(sc, displayMessages, totalCount, cancellationToken);
+ await ShowMailList(sc, displayMessages, totalCount, importantCount, cancellationToken);
return await sc.NextAsync();
}
else
@@ -705,7 +708,25 @@ protected override Task EndComponentAsync(DialogContext outerD
var searchSubject = state.SearchTexts?.ToLowerInvariant();
var searchUserInput = userInput?.ToLowerInvariant();
- messages = FilterMessages(messages, searchSender, searchSubject, searchUserInput);
+ var searchType = EmailSearchType.None;
+ (messages, searchType) = FilterMessages(messages, searchSender, searchSubject, searchUserInput);
+
+ if (searchType == EmailSearchType.SearchByContact)
+ {
+ state.SearchTexts = null;
+ if (state.SenderName == null)
+ {
+ state.SenderName = userInput;
+ }
+ }
+ else if (searchType == EmailSearchType.SearchBySubject)
+ {
+ state.SenderName = null;
+ if (state.SearchTexts == null)
+ {
+ state.SearchTexts = userInput;
+ }
+ }
state.MessageList = messages;
state.Message.Clear();
@@ -849,13 +870,15 @@ protected async Task GetPreviewSubject(WaterfallStepContext sc, string act
}
}
- protected List FilterMessages(List messages, string searchSender, string searchSubject, string searchUserInput)
+ protected (List, EmailSearchType) FilterMessages(List messages, string searchSender, string searchSubject, string searchUserInput)
{
if ((searchSender == null) && (searchSubject == null) && (searchUserInput == null))
{
- return messages;
+ return (messages, EmailSearchType.None);
}
+ var searchType = EmailSearchType.None;
+
// Get display messages
var displayMessages = new List();
for (int i = 0; i < messages.Count(); i++)
@@ -863,24 +886,53 @@ protected List FilterMessages(List messages, string searchSend
var messageSender = messages[i].Sender?.EmailAddress?.Name?.ToLowerInvariant();
var messageSubject = messages[i].Subject?.ToLowerInvariant();
- if (messageSender != null
- && (((searchSender != null) && messageSender.Contains(searchSender))
- || ((searchUserInput != null) && messageSender.Contains(searchUserInput))))
+ if (messageSender != null)
{
- displayMessages.Add(messages[i]);
+ if ((searchType == EmailSearchType.None) || (searchType == EmailSearchType.SearchByContact))
+ {
+ if (((searchSender != null) && messageSender.Contains(searchSender))
+ || ((searchUserInput != null) && messageSender.Contains(searchUserInput)))
+ {
+ displayMessages.Add(messages[i]);
+
+ searchType = EmailSearchType.SearchByContact;
+ if (searchSender == null)
+ {
+ searchSender = searchUserInput;
+ }
+
+ searchSubject = null;
+ continue;
+ }
+ }
}
- else if (messageSubject != null
- && (((searchSubject != null) && messageSubject.Contains(searchSubject))
- || ((searchUserInput != null) && messageSubject.Contains(searchUserInput))))
+
+ if (messageSubject != null)
{
- displayMessages.Add(messages[i]);
+ if ((searchType == EmailSearchType.None) || (searchType == EmailSearchType.SearchBySubject))
+ {
+ if (((searchSubject != null) && messageSubject.Contains(searchSubject))
+ || ((searchUserInput != null) && messageSubject.Contains(searchUserInput)))
+ {
+ displayMessages.Add(messages[i]);
+
+ searchType = EmailSearchType.SearchBySubject;
+ if (searchSubject == null)
+ {
+ searchSubject = searchUserInput;
+ }
+
+ searchSender = null;
+ continue;
+ }
+ }
}
}
- return displayMessages;
+ return (displayMessages, searchType);
}
- protected async Task<(List, int)> GetMessagesAsync(WaterfallStepContext sc)
+ protected async Task<(List, int, int)> GetMessagesAsync(WaterfallStepContext sc)
{
var result = new List();
@@ -903,7 +955,17 @@ protected List FilterMessages(List messages, string searchSend
// Filter messages
var searchSender = state.GeneralSenderName?.ToLowerInvariant();
var searchSubject = state.GeneralSearchTexts?.ToLowerInvariant();
- result = FilterMessages(result, searchSender, searchSubject, null);
+ var searchType = EmailSearchType.None;
+ (result, searchType) = FilterMessages(result, searchSender, searchSubject, null);
+
+ if (searchType == EmailSearchType.SearchByContact)
+ {
+ state.GeneralSearchTexts = null;
+ }
+ else if (searchType == EmailSearchType.SearchBySubject)
+ {
+ state.GeneralSenderName = null;
+ }
// Go back to last page if next page didn't get anything
if (skip >= result.Count)
@@ -913,8 +975,14 @@ protected List FilterMessages(List messages, string searchSend
// get messages for current page
var filteredResult = new List();
+ int importantEmailCount = 0;
for (var i = 0; i < result.Count; i++)
{
+ if (result[i].Importance.HasValue && result[i].Importance.Value == Importance.High)
+ {
+ importantEmailCount++;
+ }
+
if (skip > 0)
{
skip--;
@@ -925,17 +993,13 @@ protected List FilterMessages(List messages, string searchSend
{
filteredResult.Add(result[i]);
}
- else
- {
- break;
- }
}
}
- return (filteredResult, result.Count);
+ return (filteredResult, result.Count, importantEmailCount);
}
- protected async Task ShowMailList(WaterfallStepContext sc, List messages, int totalCount, CancellationToken cancellationToken = default(CancellationToken))
+ protected async Task ShowMailList(WaterfallStepContext sc, List messages, int totalCount, int importantCount, CancellationToken cancellationToken = default(CancellationToken))
{
var updatedMessages = new List();
var state = await EmailStateAccessor.GetAsync(sc.Context);
@@ -945,6 +1009,7 @@ protected List FilterMessages(List messages, string searchSend
{
var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(message.ToRecipients);
+ var senderIcon = await GetUserPhotoUrlAsync(sc.Context, message.Sender.EmailAddress);
var emailCard = new EmailCardData
{
Subject = message.Subject,
@@ -954,44 +1019,95 @@ protected List FilterMessages(List messages, string searchSend
EmailLink = message.WebLink,
ReceivedDateTime = message.ReceivedDateTime == null
? CommonStrings.NotAvailable
- : message.ReceivedDateTime.Value.UtcDateTime.ToRelativeString(state.GetUserTimeZone()),
+ : message.ReceivedDateTime.Value.UtcDateTime.ToOverallRelativeString(state.GetUserTimeZone()),
Speak = SpeakHelper.ToSpeechEmailDetailOverallString(message, state.GetUserTimeZone()),
+ SenderIcon = senderIcon
};
- cards.Add(new Card("EmailCard", emailCard));
- updatedMessages.Add(message);
- }
- var searchType = EmailCommonStrings.Relevant;
- if (state.IsUnreadOnly)
- {
- searchType = string.Format(EmailCommonStrings.RelevantFormat, EmailCommonStrings.Unread);
- }
- else if (state.IsImportant)
- {
- searchType = string.Format(EmailCommonStrings.RelevantFormat, EmailCommonStrings.Important);
+ bool isImportant = message.Importance != null && message.Importance == Importance.High;
+ bool hasAttachment = message.HasAttachments.HasValue && message.HasAttachments.Value;
+ if (isImportant && hasAttachment)
+ {
+ emailCard.AdditionalIcon1 = AdaptiveCardHelper.ImportantIcon;
+ emailCard.AdditionalIcon2 = AdaptiveCardHelper.AttachmentIcon;
+ }
+ else if (isImportant)
+ {
+ emailCard.AdditionalIcon1 = AdaptiveCardHelper.ImportantIcon;
+ }
+ else if (hasAttachment)
+ {
+ emailCard.AdditionalIcon1 = AdaptiveCardHelper.AttachmentIcon;
+ }
+
+ cards.Add(new Card("EmailOverviewItem", emailCard));
+ updatedMessages.Add(message);
}
var tokens = new StringDictionary
{
{ "TotalCount", totalCount.ToString() },
- { "EmailListDetails", SpeakHelper.ToSpeechEmailListString(updatedMessages, state.GetUserTimeZone(), ConfigData.GetInstance().MaxReadSize) },
+ { "EmailListDetails", SpeakHelper.ToSpeechEmailListString(updatedMessages, state.GetUserTimeZone(), ConfigData.GetInstance().MaxReadSize) }
+ };
+
+ var avator = await GetMyPhotoUrlAsync(sc.Context);
+ var overviewData = new EmailOverviewData()
+ {
+ Description = EmailCommonStrings.YourEmail,
+ AvatorIcon = avator,
+ TotalMessageNumber = totalCount.ToString(),
+ HighPriorityMessagesNumber = importantCount.ToString(),
+ Now = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, state.GetUserTimeZone()).ToString(EmailCommonStrings.GeneralDateFormat),
+ MailSourceType = string.Format(EmailCommonStrings.Source, state.MailSourceType.ToString())
};
- var reply = ResponseManager.GetCardResponse(EmailSharedResponses.ShowEmailPrompt, cards, tokens);
+ var overviewCard = "EmailOverviewCard";
+ if ((state.SenderName != null) || (state.GeneralSenderName != null))
+ {
+ overviewData.Description = string.Format(EmailCommonStrings.SearchBySender, state.SenderName != null ? state.SenderName : state.GeneralSenderName);
+ overviewCard = "EmailOverviewByCondition";
+ }
+ else if ((state.SearchTexts != null) || (state.GeneralSearchTexts != null))
+ {
+ overviewData.Description = string.Format(EmailCommonStrings.SearchBySubject, state.SearchTexts != null ? state.SearchTexts : state.GeneralSearchTexts);
+ overviewCard = "EmailOverviewByCondition";
+ }
+
+ var reply = ResponseManager.GetCardResponse(
+ EmailSharedResponses.ShowEmailPrompt,
+ new Card(overviewCard, overviewData),
+ tokens,
+ "items",
+ cards);
if (state.ShowEmailIndex == 0)
{
if (updatedMessages.Count == 1)
{
- reply = ResponseManager.GetCardResponse(EmailSharedResponses.ShowOneEmailPrompt, cards, tokens);
+ reply = ResponseManager.GetCardResponse(
+ EmailSharedResponses.ShowOneEmailPrompt,
+ new Card(overviewCard, overviewData),
+ tokens,
+ "items",
+ cards);
}
}
else
{
- reply = ResponseManager.GetCardResponse(EmailSharedResponses.ShowEmailPromptOtherPage, cards, tokens);
+ reply = ResponseManager.GetCardResponse(
+ EmailSharedResponses.ShowEmailPromptOtherPage,
+ new Card(overviewCard, overviewData),
+ tokens,
+ "items",
+ cards);
if (updatedMessages.Count == 1)
{
- reply = ResponseManager.GetCardResponse(EmailSharedResponses.ShowOneEmailPromptOtherPage, cards, tokens);
+ reply = ResponseManager.GetCardResponse(
+ EmailSharedResponses.ShowOneEmailPromptOtherPage,
+ new Card(overviewCard, overviewData),
+ tokens,
+ "items",
+ cards);
}
}
@@ -1015,56 +1131,104 @@ protected List FilterMessages(List messages, string searchSend
return;
}
- protected async Task> GetPeopleWorkWithAsync(ITurnContext context, string name)
+ protected async Task GetMyPhotoUrlAsync(ITurnContext context)
{
- var result = new List();
var state = await EmailStateAccessor.GetAsync(context);
var token = state.Token;
var service = ServiceManager.InitUserService(token, state.GetUserTimeZone(), state.MailSourceType);
- // Get users.
- return await service.GetPeopleAsync(name);
- }
-
- protected async Task> GetUserAsync(ITurnContext context, string name)
- {
- var result = new List();
try
{
- var state = await EmailStateAccessor.GetAsync(context);
- var token = state.Token;
- var service = ServiceManager.InitUserService(token, state.GetUserTimeZone(), state.MailSourceType);
-
- // Get users.
- var userList = await service.GetUserAsync(name);
- foreach (var user in userList)
+ var user = await service.GetMeAsync();
+ if (user != null && !string.IsNullOrEmpty(user.Photo))
{
- result.Add(user.ToPerson());
+ return user.Photo;
}
+
+ // return default value
+ return string.Format(AdaptiveCardHelper.DefaultAvatarIconPathFormat, AdaptiveCardHelper.DefaultMe);
}
- catch (ServiceException)
+ catch (Exception)
{
// won't clear conversation state hear, because sometime use api is not available, like user msa account.
+ return string.Format(AdaptiveCardHelper.DefaultAvatarIconPathFormat, AdaptiveCardHelper.DefaultMe);
}
-
- return result;
}
- protected async Task> GetContactsAsync(ITurnContext context, string name)
+ protected async Task GetUserPhotoUrlAsync(ITurnContext context, EmailAddress email)
{
- var result = new List();
var state = await EmailStateAccessor.GetAsync(context);
var token = state.Token;
var service = ServiceManager.InitUserService(token, state.GetUserTimeZone(), state.MailSourceType);
+ var displayName = email.Name != null ? email.Name : email.Address;
+
+ try
+ {
+ var url = await service.GetPhotoAsync(email.Address);
+ if (!string.IsNullOrEmpty(url))
+ {
+ return url;
+ }
- // Get users.
- var contactsList = await service.GetContactsAsync(name);
- foreach (var contact in contactsList)
+ // return default value
+ return string.Format(AdaptiveCardHelper.DefaultAvatarIconPathFormat, displayName);
+ }
+ catch (Exception)
{
- result.Add(contact.ToPerson());
+ return string.Format(AdaptiveCardHelper.DefaultAvatarIconPathFormat, displayName);
}
+ }
- return result;
+ protected async Task ProcessRecipientPhotoUrl(ITurnContext context, EmailCardData data, IEnumerable recipients)
+ {
+ try
+ {
+ var state = await EmailStateAccessor.GetAsync(context);
+
+ if (recipients == null || recipients.Count() == 0)
+ {
+ throw new Exception("No recipient!");
+ }
+
+ int size = Math.Min(AdaptiveCardHelper.MaxDisplayRecipientNum, recipients.Count());
+
+ for (int i = 0; i < size; i++)
+ {
+ var photoUrl = await GetUserPhotoUrlAsync(context, recipients.ElementAt(i).EmailAddress);
+
+ switch (i)
+ {
+ case 0:
+ data.RecipientIcon0 = photoUrl;
+ break;
+ case 1:
+ data.RecipientIcon1 = photoUrl;
+ break;
+ case 2:
+ data.RecipientIcon2 = photoUrl;
+ break;
+ case 3:
+ data.RecipientIcon3 = photoUrl;
+ break;
+ case 4:
+ data.RecipientIcon4 = photoUrl;
+ break;
+ }
+ }
+
+ if (recipients.Count() > AdaptiveCardHelper.MaxDisplayRecipientNum)
+ {
+ int additionalNumber = recipients.Count() - AdaptiveCardHelper.MaxDisplayRecipientNum - 1;
+ data.AdditionalRecipientNumber = additionalNumber.ToString();
+ }
+
+ // return default value
+ return data;
+ }
+ catch (ServiceException)
+ {
+ return null;
+ }
}
protected async Task ClearConversationState(WaterfallStepContext sc)
@@ -1081,7 +1245,7 @@ protected async Task ClearConversationState(WaterfallStepContext sc)
state.ShowEmailIndex = 0;
state.IsUnreadOnly = true;
state.IsImportant = false;
- state.StartDateTime = DateTime.UtcNow.Add(new TimeSpan(-7, 0, 0, 0));
+ state.StartDateTime = DateTime.UtcNow.Add(new TimeSpan(-100, 0, 0, 0));
state.EndDateTime = DateTime.UtcNow;
state.DirectlyToMe = false;
state.UserSelectIndex = -1;
@@ -1240,7 +1404,7 @@ protected async Task DigestEmailLuisResult(DialogContext dc, EmailLU luisResult,
foreach (var emailAddress in rawEntity)
{
var email = luisResult.Text.Substring(emailAddress.StartIndex, emailAddress.EndIndex - emailAddress.StartIndex);
- if (IsEmail(email) && !state.EmailList.Contains(email))
+ if (Util.Util.IsEmail(email) && !state.EmailList.Contains(email))
{
state.EmailList.Add(email);
}
@@ -1298,7 +1462,7 @@ protected async Task DigestEmailLuisResult(DialogContext dc, EmailLU luisResult,
foreach (var emailAddress in rawEntity)
{
var email = luisResult.Text.Substring(emailAddress.StartIndex, emailAddress.EndIndex - emailAddress.StartIndex);
- if (IsEmail(email) && !state.EmailList.Contains(email))
+ if (Util.Util.IsEmail(email) && !state.EmailList.Contains(email))
{
state.EmailList.Add(email);
}
@@ -1327,16 +1491,6 @@ protected async Task DigestEmailLuisResult(DialogContext dc, EmailLU luisResult,
}
}
- protected bool IsEmail(string email)
- {
- if (string.IsNullOrWhiteSpace(email))
- {
- return false;
- }
-
- return Regex.IsMatch(email, @"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$");
- }
-
protected bool IsReadMoreIntent(General.Intent? topIntent, string userInput)
{
var isReadMoreUserInput = userInput == null ? false : userInput.ToLowerInvariant().Contains(CommonStrings.More);
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/ConfirmCard_RecipientLessThanFive.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/ConfirmCard_RecipientLessThanFive.json
new file mode 100644
index 0000000000..57dcf217be
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/ConfirmCard_RecipientLessThanFive.json
@@ -0,0 +1,134 @@
+{
+ "type": "AdaptiveCard",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "id": "icon",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "title",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Subject}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Bottom",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "To"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon0}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon1}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon2}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon3}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon4}"
+ }
+ ],
+ "width": "auto"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/ConfirmCard_RecipientMoreThanFive.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/ConfirmCard_RecipientMoreThanFive.json
new file mode 100644
index 0000000000..595cd1e4b2
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/ConfirmCard_RecipientMoreThanFive.json
@@ -0,0 +1,138 @@
+{
+ "type": "AdaptiveCard",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "id": "icon",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "title",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Subject}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Bottom",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "To"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon0}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon1}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon2}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon3}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Center",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "\\+ {AdditionalRecipientNumber}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/DetailCard_RecipientLessThanFive.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/DetailCard_RecipientLessThanFive.json
new file mode 100644
index 0000000000..df25f34e11
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/DetailCard_RecipientLessThanFive.json
@@ -0,0 +1,206 @@
+{
+ "type": "AdaptiveCard",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "id": "icon",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "title",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Subject}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "id": "senderAvatar",
+ "style": "Person",
+ "url": "{SenderIcon}",
+ "size": "Medium"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "horizontalAlignment": "Left",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "senderName",
+ "horizontalAlignment": "Left",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Sender}"
+ }
+ ],
+ "width": "stretch"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{ReceivedDateTime}"
+ }
+ ],
+ "width": "auto"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Bottom",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "To"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon0}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon1}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon2}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon3}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon4}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/DetailCard_RecipientMoreThanFive.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/DetailCard_RecipientMoreThanFive.json
new file mode 100644
index 0000000000..24285fc934
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/DetailCard_RecipientMoreThanFive.json
@@ -0,0 +1,208 @@
+{
+ "type": "AdaptiveCard",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "id": "icon",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "title",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Subject}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "Image",
+ "id": "senderAvatar",
+ "style": "Person",
+ "url": "{SenderIcon}",
+ "size": "Medium"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "horizontalAlignment": "Left",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "senderName",
+ "horizontalAlignment": "Left",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Sender}"
+ }
+ ],
+ "width": "stretch"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{ReceivedDateTime}"
+ }
+ ],
+ "width": "auto"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Bottom",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "To"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon0}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon1}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon2}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "style": "Person",
+ "url": "{RecipientIcon3}",
+ "size": "Small"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Center",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "\\+ {AdditionalRecipientNumber}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCard.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCard.json
deleted file mode 100644
index 87b0d8933e..0000000000
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCard.json
+++ /dev/null
@@ -1,81 +0,0 @@
-{
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
- "type": "AdaptiveCard",
- "version": "1.0",
- "speak": "{Speak}",
- "id": "EmailCard",
- "body": [
- {
- "type": "Container",
- "items": [
- {
- "type": "ColumnSet",
- "columns": [
- {
- "type": "Column",
- "width": "stretch",
- "items": [
- {
- "type": "TextBlock",
- "text": "{Sender}",
- "weight": "bolder",
- "size": "large",
- "maxLines": 1
- },
- {
- "type": "TextBlock",
- "text": "{Subject}",
- "weight": "bolder",
- "size": "large",
- "maxLines": 1
- }
- ]
- }
- ]
- },
- {
- "type": "ColumnSet",
- "columns": [
- {
- "type": "Column",
- "width": "stretch",
- "items": [
- {
- "type": "TextBlock",
- "spacing": "none",
- "text": "{ReceivedDateTime}",
- "isSubtle": true,
- "wrap": true
- },
- {
- "type": "TextBlock",
- "text": "{NameList}",
- "weight": "bolder",
- "wrap": true
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "Container",
- "items": [
- {
- "type": "TextBlock",
- "text": "{EmailContent}",
- "wrap": true,
- "maxLines": 2
- }
- ]
- }
- ],
- "actions": [
- {
- "type": "Action.OpenUrl",
- "title": "View",
- "url": "{EmailLink}"
- }
- ]
-}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardData.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardData.cs
index c299d74fb7..eee5f3a302 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardData.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardData.cs
@@ -1,4 +1,5 @@
-using Microsoft.Bot.Builder.Solutions.Responses;
+using EmailSkill.Util;
+using Microsoft.Bot.Builder.Solutions.Responses;
namespace EmailSkill.Dialogs.Shared.Resources.Cards
{
@@ -17,5 +18,26 @@ public class EmailCardData : ICardData
public string EmailLink { get; set; }
public string Speak { get; set; }
+
+ public string SenderIcon { get; set; }
+
+ // Placeholder for important email flag or email attachment
+ public string AdditionalIcon1 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ // Placeholder for email attachment
+ public string AdditionalIcon2 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ // RecipientIcons
+ public string RecipientIcon0 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ public string RecipientIcon1 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ public string RecipientIcon2 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ public string RecipientIcon3 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ public string RecipientIcon4 { get; set; } = AdaptiveCardHelper.DefaultIcon;
+
+ public string AdditionalRecipientNumber { get; set; }
}
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardDataNoButtons.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardDataNoButtons.cs
deleted file mode 100644
index 594d43ebbe..0000000000
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailCardDataNoButtons.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Microsoft.Bot.Builder.Solutions.Responses;
-
-namespace EmailSkill.Dialogs.Shared.Resources.Cards
-{
- public class EmailCardDataNoButtons : ICardData
- {
- public string Subject { get; set; }
-
- public string Sender { get; set; }
-
- public string NameList { get; set; }
-
- public string ReceivedDateTime { get; set; }
-
- public string EmailContent { get; set; }
-
- public string EmailLink { get; set; }
-
- public string Speak { get; set; }
- }
-}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailContentPreview.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailContentPreview.json
index 191281dfba..a9490428e7 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailContentPreview.json
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailContentPreview.json
@@ -1,20 +1,75 @@
{
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
- "version": "1.0",
- "speak": "{Speak}",
- "id": "EmailContentPreview",
+ "id": "EmailCard",
+ "backgroundImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAACeCAYAAACvg+F+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxOTowMzoxMyAxOTo0Mjo0OBCBEeIAAAG8SURBVHhe7dJBDQAgEMCwA/+egQcmlrSfGdg6z0DE/oUEw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phCZm52U4FOCAVGHQAAAAASUVORK5CYII=",
"body": [
+ {
+ "type": "Container",
+ "id": "title",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "id": "icon",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "id": "title",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Subject}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ },
{
"type": "Container",
"items": [
{
"type": "TextBlock",
+ "id": "messageBody",
+ "color": "Dark",
"text": "{EmailContent}",
- "wrap": true,
- "maxLines": 5
+ "wrap": true
}
]
}
- ]
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0",
+ "speak": "{Speak}"
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailDetailCard.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailDetailCard.json
index a7e8e25716..01a27e1c09 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailDetailCard.json
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailDetailCard.json
@@ -1,72 +1,25 @@
{
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
- "version": "1.0",
- "speak": "{Speak}",
- "id": "EmailDetailCard",
+ "id": "EmailCard",
+ "backgroundImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAACeCAYAAACvg+F+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxOTowMzoxMyAxOTo0Mjo0OBCBEeIAAAG8SURBVHhe7dJBDQAgEMCwA/+egQcmlrSfGdg6z0DE/oUEw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phCZm52U4FOCAVGHQAAAAASUVORK5CYII=",
"body": [
{
"type": "Container",
- "items": [
- {
- "type": "ColumnSet",
- "columns": [
- {
- "type": "Column",
- "width": "stretch",
- "items": [
- {
- "type": "TextBlock",
- "text": "{Sender}",
- "weight": "bolder",
- "size": "large",
- "maxLines": 1
- },
- {
- "type": "TextBlock",
- "text": "{Subject}",
- "weight": "bolder",
- "size": "large",
- "maxLines": 1
- }
- ]
- }
- ]
- },
- {
- "type": "ColumnSet",
- "columns": [
- {
- "type": "Column",
- "width": "stretch",
- "items": [
- {
- "type": "TextBlock",
- "spacing": "none",
- "text": "{ReceivedDateTime}",
- "isSubtle": true,
- "wrap": true
- },
- {
- "type": "TextBlock",
- "text": "{NameList}",
- "weight": "bolder",
- "wrap": true
- }
- ]
- }
- ]
- }
- ]
+ "id": "items",
+ "items": []
},
+
{
"type": "Container",
+ "spacing": "Medium",
"items": [
{
"type": "TextBlock",
+ "id": "messageBody",
+ "color": "Dark",
"text": "{EmailContent}",
"wrap": true,
- "maxLines": 3
+ "maxLines": 5
}
]
}
@@ -77,5 +30,8 @@
"title": "View",
"url": "{EmailLink}"
}
- ]
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0",
+ "speak": "{Speak}"
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewByCondition.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewByCondition.json
new file mode 100644
index 0000000000..3e62f5901a
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewByCondition.json
@@ -0,0 +1,134 @@
+{
+ "type": "AdaptiveCard",
+ "backgroundImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAACeCAYAAACvg+F+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxOTowMzoxMyAxOTo0Mjo0OBCBEeIAAAG8SURBVHhe7dJBDQAgEMCwA/+egQcmlrSfGdg6z0DE/oUEw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phCZm52U4FOCAVGHQAAAAASUVORK5CYII=",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "Image",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "size": "Small",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "height": "stretch",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Description}",
+ "wrap": true,
+ "maxLines": 2
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "spacing": "Medium",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "height": "stretch",
+ "size": "Medium",
+ "color": "Light",
+ "text": "{TotalMessageNumber}"
+ },
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "size": "Medium",
+ "color": "Light",
+ "text": "{HighPriorityMessagesNumber}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "TextBlock",
+ "height": "stretch",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{MessagesDescription}"
+ },
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{ImportantMessagesDescription}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "Container",
+ "id": "items",
+ "items": []
+ },
+ {
+ "type": "Container",
+ "separator": true,
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "size": "Small",
+ "color": "Dark",
+ "text": "{MailSourceType}"
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewCard.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewCard.json
new file mode 100644
index 0000000000..90898425a9
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewCard.json
@@ -0,0 +1,164 @@
+{
+ "type": "AdaptiveCard",
+ "backgroundImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAACeCAYAAACvg+F+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxOTowMzoxMyAxOTo0Mjo0OBCBEeIAAAG8SURBVHhe7dJBDQAgEMCwA/+egQcmlrSfGdg6z0DE/oUEw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phCZm52U4FOCAVGHQAAAAASUVORK5CYII=",
+ "body": [
+ {
+ "type": "Container",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "backgroundImage": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRw%0D%0AOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEyIDExMCI+PGRlZnM+PHN0%0D%0AeWxlPi5he2ZpbGw6IzY1YWZlMjt9LmJ7b3BhY2l0eTowLjI7ZmlsbDp1cmwoI2EpO30uY3tmaWxs%0D%0AOiMwMDU4YTg7b3BhY2l0eTowLjI1O308L3N0eWxlPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9%0D%0AIjIyOC44NyIgeTE9IjU1IiB4Mj0iNDQ5LjM0IiB5Mj0iNTUiIGdyYWRpZW50VW5pdHM9InVzZXJT%0D%0AcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0%0D%0AeT0iMC41Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+PC9saW5lYXJHcmFk%0D%0AaWVudD48L2RlZnM+PHRpdGxlPnBsYXRmb3Jtc0Fzc2V0IDQ4cXVlc2l0b25zPC90aXRsZT48cGF0%0D%0AaCBjbGFzcz0iYSIgZD0iTTIzMC43NCw1NS4wNywyODUuODIsMEgwVjExMEgyNzYuNjFMMjMwLjc0%0D%0ALDY0LjEzQTYuNDMsNi40MywwLDAsMSwyMzAuNzQsNTUuMDdaIi8+PHBhdGggY2xhc3M9ImEiIGQ9%0D%0AIk0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3YTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYx%0D%0ALDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImIiIGQ9Ik0zMTIsMEgyODUuODJMMjMwLjc0LDU1LjA3%0D%0AYTYuNDMsNi40MywwLDAsMCwwLDkuMDZMMjc2LjYxLDExMEgzMTJaIi8+PHBhdGggY2xhc3M9ImMi%0D%0AIGQ9Ik0yNDIuNiwyMi4zMiwzMTIsOTEuNzJWMEgyNTUuODdMMjQyLjYsMTMuMjdBNi40Miw2LjQy%0D%0ALDAsMCwwLDI0Mi42LDIyLjMyWiIvPjwvc3ZnPg==",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "Image",
+ "horizontalAlignment": "Center",
+ "url": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5z%0D%0APSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMu%0D%0Ab3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNS42IDIyLjUi%0D%0AIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1LjYgMjIuNTsiIHhtbDpzcGFjZT0i%0D%0AcHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8%0D%0AL3N0eWxlPgo8dGl0bGU+cGxhdGZvcm1zQXNzZXQgMzBxdWVzaXRvbnM8L3RpdGxlPgo8cGF0aCBj%0D%0AbGFzcz0ic3QwIiBkPSJNMTIuOCwwbDEyLjgsNi40djE2LjFIMFY2LjRMMTIuOCwweiBNMS42LDIw%0D%0ALjlIMjRWOS4ybC0zLjcsMy43SDUuM0wxLjYsOS4yVjIwLjl6IE0yMy43LDcuMkwxMi44LDEuOEwx%0D%0ALjksNy4yCglsNCw0aDEzLjhMMjMuNyw3LjJ6Ii8+Cjwvc3ZnPgo=",
+ "width": "35px",
+ "height": "35px"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "height": "stretch",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Large",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Description}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "height": "stretch",
+ "size": "Medium",
+ "color": "Light",
+ "text": "{TotalMessageNumber}"
+ },
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "size": "Medium",
+ "color": "Light",
+ "text": "{HighPriorityMessagesNumber}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "TextBlock",
+ "height": "stretch",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{MessagesDescription}"
+ },
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{ImportantMessagesDescription}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": 60
+ },
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "Image",
+ "horizontalAlignment": "Center",
+ "style": "Person",
+ "url": "{AvatorIcon}",
+ "width": "80px",
+ "height": "80px"
+ },
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Center",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Light",
+ "text": "{Now}"
+ }
+ ],
+ "width": 40
+ }
+ ]
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "type": "Container",
+ "id": "items",
+ "items": []
+ },
+ {
+ "type": "Container",
+ "separator": true,
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "size": "Small",
+ "color": "Dark",
+ "text": "{MailSourceType}"
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewData.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewData.cs
new file mode 100644
index 0000000000..31b94a8dc8
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewData.cs
@@ -0,0 +1,24 @@
+using EmailSkill.Dialogs.Shared.Resources.Strings;
+using Microsoft.Bot.Builder.Solutions.Responses;
+
+namespace EmailSkill.Dialogs.Shared.Resources.Cards
+{
+ public class EmailOverviewData : ICardData
+ {
+ public string Description { get; set; }
+
+ public string AvatorIcon { get; set; }
+
+ public string TotalMessageNumber { get; set; }
+
+ public string HighPriorityMessagesNumber { get; set; }
+
+ public string Now { get; set; }
+
+ public string MailSourceType { get; set; }
+
+ public string MessagesDescription { get; } = EmailCommonStrings.Messages;
+
+ public string ImportantMessagesDescription { get; } = EmailCommonStrings.ImportantMessages;
+ }
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewItem.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewItem.json
new file mode 100644
index 0000000000..76e2268882
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailOverviewItem.json
@@ -0,0 +1,118 @@
+{
+ "type": "AdaptiveCard",
+ "body": [
+ {
+ "type": "Container",
+ "separator": true,
+ "items": [
+ {
+ "type": "ColumnSet",
+ "separator": true,
+ "height": "stretch",
+ "columns": [
+ {
+ "type": "Column",
+ "height": "stretch",
+ "items": [
+ {
+ "type": "Image",
+ "horizontalAlignment": "Center",
+ "height": "stretch",
+ "style": "Person",
+ "url": "{SenderIcon}",
+ "size": "Medium"
+ }
+ ],
+ "width": 15
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "ColumnSet",
+ "columns": [
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "TextBlock",
+ "size": "Medium",
+ "weight": "Bolder",
+ "color": "Dark",
+ "text": "{Subject}"
+ }
+ ],
+ "width": 95
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "horizontalAlignment": "Center",
+ "url": "{AdditionalIcon2}",
+ "width": "20px",
+ "height": "20px"
+ }
+ ],
+ "width": 5
+ },
+ {
+ "type": "Column",
+ "verticalContentAlignment": "Center",
+ "items": [
+ {
+ "type": "Image",
+ "horizontalAlignment": "Center",
+ "url": "{AdditionalIcon1}",
+ "width": "20px",
+ "height": "20px"
+ }
+ ],
+ "width": 5
+ }
+ ]
+ },
+ {
+ "type": "ColumnSet",
+ "spacing": "Small",
+ "columns": [
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "TextBlock",
+ "color": "Dark",
+ "text": "{Sender}"
+ }
+ ],
+ "width": "auto"
+ },
+ {
+ "type": "Column",
+ "items": [
+ {
+ "type": "TextBlock",
+ "horizontalAlignment": "Right",
+ "color": "Dark",
+ "text": "{ReceivedDateTime}"
+ }
+ ],
+ "width": "stretch"
+ }
+ ]
+ }
+ ],
+ "width": 80
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0"
+}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailWithOutButtonCard.json b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailWithOutButtonCard.json
index 251e7fc091..8c2379f99e 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailWithOutButtonCard.json
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Cards/EmailWithOutButtonCard.json
@@ -1,49 +1,27 @@
{
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
- "version": "1.0",
- "speak": "{Speak}",
- "id": "EmailWithOutButtonCard",
+ "id": "EmailCard",
+ "backgroundImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAACeCAYAAACvg+F+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAhdEVYdENyZWF0aW9uIFRpbWUAMjAxOTowMzoxMyAxOTo0Mjo0OBCBEeIAAAG8SURBVHhe7dJBDQAgEMCwA/+egQcmlrSfGdg6z0DE/oUEw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phSTEsKYYlxbCkGJYUw5JiWFIMS4phCZm52U4FOCAVGHQAAAAASUVORK5CYII=",
"body": [
{
"type": "Container",
- "items": [
- {
- "type": "TextBlock",
- "text": "{Subject}",
- "weight": "bolder",
- "size": "large",
- "maxLines": 2
- },
- {
- "type": "ColumnSet",
- "columns": [
- {
- "type": "Column",
- "width": "stretch",
- "items": [
- {
- "type": "TextBlock",
- "text": "{NameList}",
- "weight": "bolder",
- "wrap": true
- }
- ]
- }
- ]
- }
- ]
+ "id": "items",
+ "items": []
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
+ "id": "messageBody",
+ "color": "Dark",
"text": "{EmailContent}",
- "wrap": true,
- "maxLines": 2
+ "wrap": true
}
]
}
- ]
+ ],
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "version": "1.0",
+ "speak": "{Speak}"
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.Designer.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.Designer.cs
index 95e2e688e8..e3aea52e72 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.Designer.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.Designer.cs
@@ -123,6 +123,15 @@ public static string DateFormat {
}
}
+ ///
+ /// Looks up a localized string similar to ddd MM/dd hh:mm tt.
+ ///
+ public static string DisplayDetailDateFormat {
+ get {
+ return ResourceManager.GetString("DisplayDetailDateFormat", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to On {0}, {1} wrote:.
///
@@ -213,6 +222,15 @@ public static string FromFormat {
}
}
+ ///
+ /// Looks up a localized string similar to MMM dd, yyyy.
+ ///
+ public static string GeneralDateFormat {
+ get {
+ return ResourceManager.GetString("GeneralDateFormat", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to high.
///
@@ -231,6 +249,33 @@ public static string Important {
}
}
+ ///
+ /// Looks up a localized string similar to High Priority Messages.
+ ///
+ public static string ImportantMessages {
+ get {
+ return ResourceManager.GetString("ImportantMessages", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Message Confirmation.
+ ///
+ public static string MessageConfirm {
+ get {
+ return ResourceManager.GetString("MessageConfirm", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Messages.
+ ///
+ public static string Messages {
+ get {
+ return ResourceManager.GetString("Messages", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to participants.
///
@@ -240,6 +285,15 @@ public static string Participants {
}
}
+ ///
+ /// Looks up a localized string similar to ddd MM/dd.
+ ///
+ public static string PreviousDateFormat {
+ get {
+ return ResourceManager.GetString("PreviousDateFormat", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to relevant.
///
@@ -276,6 +330,24 @@ public static string ReplyReplyFormat {
}
}
+ ///
+ /// Looks up a localized string similar to Messages from {0}.
+ ///
+ public static string SearchBySender {
+ get {
+ return ResourceManager.GetString("SearchBySender", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Messages about {0}.
+ ///
+ public static string SearchBySubject {
+ get {
+ return ResourceManager.GetString("SearchBySubject", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to skip | pass | no.
///
@@ -285,6 +357,15 @@ public static string Skip {
}
}
+ ///
+ /// Looks up a localized string similar to Powered by **{0}**.
+ ///
+ public static string Source {
+ get {
+ return ResourceManager.GetString("Source", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to |.
///
@@ -312,6 +393,15 @@ public static string SubjectFormat {
}
}
+ ///
+ /// Looks up a localized string similar to hh:mm tt.
+ ///
+ public static string TodayDateFormat {
+ get {
+ return ResourceManager.GetString("TodayDateFormat", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to {0} to {1} and content is {2}.
///
@@ -356,5 +446,14 @@ public static string Unread {
return ResourceManager.GetString("Unread", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Your Email.
+ ///
+ public static string YourEmail {
+ get {
+ return ResourceManager.GetString("YourEmail", resourceCulture);
+ }
+ }
}
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.de.resx b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.de.resx
index b08318b516..708aedaa01 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.de.resx
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.de.resx
@@ -117,6 +117,9 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Hohe Priorität
+
Auf {0} schrieb {1}:
@@ -126,9 +129,15 @@
Ungelesene
+
+ ddd MM/dd hh:mm tt
+
Inhalt
+
+ Teilnehmer
+
Cc: {0}
@@ -138,11 +147,14 @@
Datum: {0}
+
+ Meldungen über {0}
+
Betreff
-
- Aus {0} erhalten {1} titelte {2}, Inhalt ist {3}.
+
+ Von: {0}
Abbrechen
@@ -150,12 +162,18 @@
Leere Themen
+
+ Nachrichten
+
RE: {0}
Zu: {0}
+
+ Ihre Email
+
Relevant {0}
@@ -180,11 +198,17 @@
Thema: {0}
+
+ Powered by **{0}**
+
Inhalt: {0}
-
- Re:
+
+ ddd MM/dd
+
+
+ hh:mm tt
Relevanten
@@ -201,19 +225,28 @@
Hoch
+
+ Re:
+
; | Und
Fw:
-
- Von: {0}
+
+ Message-Bestätigung
----------weiterleitete Nachricht----------
-
- Teilnehmer
+
+ Aus {0} erhalten {1} titelte {2}, Inhalt ist {3}.
+
+
+ Nachrichten aus {0}
+
+
+ MMM dd, yyyy
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.es.resx b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.es.resx
index 1449103eed..01e8c92ace 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.es.resx
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.es.resx
@@ -117,6 +117,9 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Mensajes de alta prioridad
+
En {0}, {1} escribió:
@@ -126,35 +129,50 @@
no leídos
+
+ ddd MM/dd hh:mm tt
+
Contenido
+
+ Participantes
+
CC: {0}
- Contenido vacío
+ El contenido vacío
Fecha: {0}
+
+ Los mensajes sobre {0}
+
Asunto
-
- de {0} recibido {1} titulado {2}, el contenido es {3}.
+
+ Desde: {0}
Cancelar
- Tema vacío
+ Sujeto vacío
+
+
+ Mensajes
RE: {0}
- A: {0}
+ Para: {0}
+
+
+ Su correo electrónico
relevante {0}
@@ -169,10 +187,10 @@
FW: {0}
- desde {0} recibido {1} titulado {2}
+ de {0} recibido {1} titulado {2}
- desde {0} recibido {1}
+ de {0} recibido {1}
{0} a {1} y el contenido es {2}
@@ -180,11 +198,17 @@
Asunto: {0}
+
+ Con tecnología de **{0}**
+
Contenido: {0}
-
- re
+
+ ddd MM/dd
+
+
+ hh:mm tt
Relevante
@@ -201,19 +225,28 @@
Alto
+
+ re
+
; | Y
Fw:
-
- Desde: {0}
+
+ Confirmación de mensaje
----------Mensaje reenviado----------
-
- Participantes
+
+ de {0} recibido {1} titulado {2}, el contenido es {3}.
+
+
+ Los mensajes de {0}
+
+
+ MMM dd, yyyy
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.fr.resx b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.fr.resx
index 08bb8f97da..9b8c484b4b 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.fr.resx
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.fr.resx
@@ -117,6 +117,9 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Messages haute priorité
+
Sur {0}, {1} a écrit:
@@ -126,9 +129,15 @@
non lus
+
+ ddd MM/dd hh:mm tt
+
Contenu
+
+ Participants
+
CC: {0}
@@ -138,11 +147,14 @@
Date: {0}
+
+ Messages sur {0}
+
Objet
-
- à partir de {0} reçu {1} intitulé {2}, le contenu est {3}.
+
+ À partir de: {0}
Annuler
@@ -150,12 +162,18 @@
Sujet vide
+
+ Messages
+
RE: {0}
Vers: {0}
+
+ Votre email
+
{0} pertinents
@@ -180,11 +198,17 @@
Objet: {0}
+
+ Alimenté par **{0}**
+
Contenu: {0}
-
- Re:
+
+ ddd MM/dd
+
+
+ hh:mm tt
Pertinent
@@ -201,19 +225,28 @@
Haute
+
+ Re:
+
; | Et
Fw:
-
- À partir de: {0}
+
+ Confirmation de message
----------Message transféré----------
-
- Participants
+
+ à partir de {0} reçu {1} intitulé {2}, le contenu est {3}.
+
+
+ Messages de {0}
+
+
+ MMM dd, yyyy
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.it.resx b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.it.resx
index 3fcd9306e0..7b98709545 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.it.resx
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.it.resx
@@ -117,6 +117,9 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Messaggi ad alta priorità
+
Su {0}, {1} ha scritto:
@@ -126,9 +129,15 @@
non letti
+
+ ddd MM/dd hh:mm tt
+
Contenuto
+
+ Partecipanti
+
Cc: {0}
@@ -138,11 +147,14 @@
Data: {0}
+
+ Messaggi relativi a {0}
+
Oggetto
-
- da {0} ricevuto {1} intitolato {2}, il contenuto è {3}.
+
+ A partire da: {0}
Annulla
@@ -150,12 +162,18 @@
Soggetto vuoto
+
+ Messaggi
+
RE: {0}
A: {0}
+
+ La tua email
+
rilevanti {0}
@@ -180,11 +198,17 @@
Oggetto: {0}
+
+ Alimentato da **{0}**
+
Contenuto: {0}
-
- Re
+
+ ddd MM/dd
+
+
+ hh:mm tt
rilevante
@@ -201,19 +225,28 @@
alto
+
+ Re
+
; | E
Fw:
-
- A partire da: {0}
+
+ Conferma messaggio
----------Messaggio inoltrato----------
-
- Partecipanti
+
+ da {0} ricevuto {1} intitolato {2}, il contenuto è {3}.
+
+
+ Messaggi da {0}
+
+
+ MMM dd, yyyy
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.resx b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.resx
index 49bf49e270..065a02edff 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.resx
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.resx
@@ -216,4 +216,37 @@
from {0} recieved {1} titled {2}, content is {3}.
+
+ ddd MM/dd hh:mm tt
+
+
+ MMM dd, yyyy
+
+
+ ddd MM/dd
+
+
+ hh:mm tt
+
+
+ High Priority Messages
+
+
+ Message Confirmation
+
+
+ Messages
+
+
+ Messages from {0}
+
+
+ Messages about {0}
+
+
+ Powered by **{0}**
+
+
+ Your Email
+
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.zh.resx b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.zh.resx
index 61fdca048c..c35e326132 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.zh.resx
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/Shared/Resources/Strings/EmailCommonStrings.zh.resx
@@ -117,8 +117,11 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 重要邮件
+
- 在{0}上,{1}写道:
+ 在{0}上, {1}写道:
未知收件人
@@ -126,35 +129,50 @@
未读
+
+ ddd MM/dd hh:mm tt
+
内容
+
+ 参与者
+
- 抄送:{0}
+ Cc:{0}
- 空白内容
+ 空内容
- 日期:{0}
+ 日期: {0}
+
+
+ 关于{0}的消息
主题
- 发件人:{0}
+ 发件人:{0}
取消
- 空白主题
+ 空主题
+
+
+ 邮件
- Re:{0}
+ Re: {0}
- 发送至:{0}
+ 收件人:{0}
+
+
+ 您的电子邮件地址
相关{0}
@@ -166,7 +184,7 @@
未知发件人
- Fw:{0}
+ FW:{0}
来自{0}于{1}标题是{2}
@@ -178,13 +196,19 @@
{0}发送至{1}, 内容是{2}
- 主题:{0}
+ 主题:{0}
+
+
+ 由**{0}**提供支持
- 内容:{0}
+ 内容:{0}
-
- Re:
+
+ ddd MM/dd
+
+
+ hh:mm tt
相关
@@ -201,19 +225,28 @@
高
+
+ Re:
+
;|;|和
- Fw:
+ Fw:
+
+
+ 消息确认
----------转发的邮件----------
-
- 参与者
-
来自{0}于{1}标题是{2},内容为{3}。
+
+ 来自{0}的消息
+
+
+ MMM dd, yyyy
+
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ShowEmail/ShowEmailDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ShowEmail/ShowEmailDialog.cs
index e6c4071327..107d168687 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ShowEmail/ShowEmailDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Dialogs/ShowEmail/ShowEmailDialog.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;
@@ -22,6 +23,7 @@
using Microsoft.Bot.Builder.Solutions.Responses;
using Microsoft.Bot.Builder.Solutions.Skills;
using Microsoft.Bot.Builder.Solutions.Util;
+using Microsoft.Graph;
namespace EmailSkill.Dialogs.ShowEmail
{
@@ -246,31 +248,35 @@ public ShowEmailDialog(
|| (promptRecognizerResult.Succeeded && promptRecognizerResult.Value == true))
&& message != null)
{
- var nameListString = DisplayHelper.ToDisplayRecipientsString_Summay(message.ToRecipients);
-
+ var senderIcon = await GetUserPhotoUrlAsync(sc.Context, message.Sender.EmailAddress);
var emailCard = new EmailCardData
{
Subject = message.Subject,
Sender = message.Sender.EmailAddress.Name,
- NameList = string.Format(EmailCommonStrings.ToFormat, nameListString),
EmailContent = message.BodyPreview,
EmailLink = message.WebLink,
ReceivedDateTime = message?.ReceivedDateTime == null
? CommonStrings.NotAvailable
- : message.ReceivedDateTime.Value.UtcDateTime.ToRelativeString(state.GetUserTimeZone()),
+ : message.ReceivedDateTime.Value.UtcDateTime.ToDetailRelativeString(state.GetUserTimeZone()),
Speak = SpeakHelper.ToSpeechEmailDetailOverallString(message, state.GetUserTimeZone()),
+ SenderIcon = senderIcon
};
+ emailCard = await ProcessRecipientPhotoUrl(sc.Context, emailCard, message.ToRecipients);
+
var tokens = new StringDictionary()
{
{ "EmailDetails", SpeakHelper.ToSpeechEmailDetailString(message, state.GetUserTimeZone()) },
{ "EmailDetailsWithContent", SpeakHelper.ToSpeechEmailDetailString(message, state.GetUserTimeZone(), true) },
};
+ var recipientCard = message.ToRecipients.Count() > 5 ? "DetailCard_RecipientMoreThanFive" : "DetailCard_RecipientLessThanFive";
var replyMessage = ResponseManager.GetCardResponse(
ShowEmailResponses.ReadOutMessage,
new Card("EmailDetailCard", emailCard),
- tokens);
+ tokens,
+ "items",
+ new List().Append(new Card(recipientCard, emailCard)));
// Set email as read.
var service = ServiceManager.InitMailService(state.Token, state.GetUserTimeZone(), state.MailSourceType);
@@ -483,7 +489,17 @@ public ShowEmailDialog(
if (state.MessageList.Count > 1)
{
- await ShowMailList(sc, state.MessageList, state.MessageList.Count(), cancellationToken);
+ int importCount = 0;
+
+ foreach (var msg in state.MessageList)
+ {
+ if (msg.Importance.HasValue && msg.Importance.Value == Importance.High)
+ {
+ importCount++;
+ }
+ }
+
+ await ShowMailList(sc, state.MessageList, state.MessageList.Count(), importCount, cancellationToken);
return await sc.NextAsync();
}
else if (state.MessageList.Count == 1)
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkill.csproj b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkill.csproj
index da0ad3ccdb..4ced28783d 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkill.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkill.csproj
@@ -22,7 +22,7 @@
-
+
@@ -127,9 +127,15 @@
-
+
+
+
+
+
+
+
@@ -144,7 +150,7 @@
-
+
DeleteEmailResponses.cs
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkillState.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkillState.cs
index 14d4ddfaca..2beaa3531b 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkillState.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/EmailSkillState.cs
@@ -35,13 +35,13 @@ public EmailSkillState()
ReadRecipientIndex = 0;
RecipientChoiceList = new List();
DirectlyToMe = false;
- StartDateTime = DateTime.UtcNow.Add(new TimeSpan(-7, 0, 0, 0));
+ StartDateTime = DateTime.UtcNow.Add(new TimeSpan(-100, 0, 0, 0));
EndDateTime = DateTime.UtcNow;
UserSelectIndex = -1;
MailSourceType = MailSource.Other;
- UnconfirmedPerson = new List();
+ UnconfirmedPerson = new List();
FirstRetryInFindContact = true;
- ConfirmedPerson = new Person();
+ ConfirmedPerson = new PersonModel();
FirstEnterFindContact = true;
SearchTexts = null;
GeneralSenderName = null;
@@ -92,11 +92,11 @@ public EmailSkillState()
public int ConfirmRecipientIndex { get; set; }
- public List UnconfirmedPerson { get; set; }
+ public List UnconfirmedPerson { get; set; }
public bool FirstRetryInFindContact { get; set; }
- public Person ConfirmedPerson { get; set; }
+ public PersonModel ConfirmedPerson { get; set; }
public bool DirectlyToMe { get; set; }
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/DateTimeEx.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/DateTimeEx.cs
index dc7fed262d..414ba1450e 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/DateTimeEx.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/DateTimeEx.cs
@@ -4,6 +4,7 @@
namespace EmailSkill.Extensions
{
using System;
+ using global::EmailSkill.Dialogs.Shared.Resources.Strings;
using Microsoft.Bot.Builder.Solutions.Resources;
///
@@ -76,5 +77,27 @@ public static string ToRelativeString(this DateTime dateTime, TimeZoneInfo timeZ
// Add time
return string.Format(CommonStrings.AtTimeDetailsFormat, date, dateTimeWithTimeZone.ToString(CommonStrings.DisplayTime));
}
+
+ public static string ToDetailRelativeString(this DateTime dateTime, TimeZoneInfo timeZoneInfo)
+ {
+ // Change to local time
+ var dateTimeWithTimeZone = TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZoneInfo);
+
+ return dateTimeWithTimeZone.ToString(EmailCommonStrings.DisplayDetailDateFormat);
+ }
+
+ public static string ToOverallRelativeString(this DateTime dateTime, TimeZoneInfo timeZoneInfo)
+ {
+ // Change to local time
+ var dateTimeWithTimeZone = TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZoneInfo);
+ var nowWithTimeZone = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, timeZoneInfo);
+
+ if (dateTimeWithTimeZone.Day == nowWithTimeZone.Day)
+ {
+ return dateTimeWithTimeZone.ToString(EmailCommonStrings.TodayDateFormat);
+ }
+
+ return dateTimeWithTimeZone.ToString(EmailCommonStrings.PreviousDateFormat);
+ }
}
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/UserEx.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/UserEx.cs
index 7f909eaf8f..ae8e386e4d 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/UserEx.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Extensions/UserEx.cs
@@ -23,6 +23,7 @@ public static Person ToPerson(this User user)
var person = new Person
{
+ Id = user.Id,
DisplayName = user.DisplayName,
UserPrincipalName = user.UserPrincipalName,
Surname = user.Surname,
@@ -50,6 +51,7 @@ public static Person ToPerson(this Contact contact)
var person = new Person
{
+ Id = contact.Id,
DisplayName = contact.DisplayName,
UserPrincipalName = null,
Surname = contact.Surname,
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Model/EmailSearchType.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Model/EmailSearchType.cs
new file mode 100644
index 0000000000..727364da55
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Model/EmailSearchType.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace EmailSkill.Model
+{
+ ///
+ /// Source of event.
+ ///
+ public enum EmailSearchType
+ {
+ ///
+ /// None.
+ ///
+ None,
+
+ ///
+ /// Search By Contact.
+ ///
+ SearchByContact,
+
+ ///
+ /// Search By Subject.
+ ///
+ SearchBySubject
+ }
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Model/PersonModel.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Model/PersonModel.cs
new file mode 100644
index 0000000000..1be6d5cec5
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Model/PersonModel.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT license.
+
+using System;
+using System.Collections.Generic;
+
+namespace EmailSkill.Model
+{
+ ///
+ /// Event mapping entity.
+ ///
+ public partial class PersonModel
+ {
+ ///
+ /// The person source.
+ ///
+ private MailSource source;
+
+ ///
+ /// Initializes a new instance of the class.、
+ /// DO NOT USE THIS ONE.
+ ///
+ public PersonModel()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class from MS Graph person.
+ ///
+ /// MS Graph person.
+ public PersonModel(Microsoft.Graph.Person msftPerson)
+ {
+ source = MailSource.Microsoft;
+ this.Id = msftPerson.Id;
+ this.DisplayName = msftPerson?.DisplayName;
+ this.UserPrincipalName = msftPerson?.UserPrincipalName;
+
+ this.Emails = new List();
+ if (msftPerson?.ScoredEmailAddresses != null)
+ {
+ foreach (var email in msftPerson.ScoredEmailAddresses)
+ {
+ this.Emails.Add(email.Address);
+ }
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class from Google person.
+ ///
+ /// Google person.
+ public PersonModel(Google.Apis.People.v1.Data.Person gmailPerson)
+ {
+ source = MailSource.Google;
+ this.Id = gmailPerson?.EmailAddresses?[0]?.Value;
+ this.DisplayName = gmailPerson?.Names?[0]?.DisplayName;
+ this.UserPrincipalName = gmailPerson?.Names?[0]?.DisplayNameLastFirst; ;
+
+ this.Emails = new List();
+ if (gmailPerson?.EmailAddresses != null)
+ {
+ foreach (var email in gmailPerson.EmailAddresses)
+ {
+ this.Emails.Add(email.Value);
+ }
+ }
+
+ this.Photo = gmailPerson?.Photos?[0]?.Url;
+ }
+
+ public string Id {get; set;}
+
+ public string DisplayName {get; set;}
+
+ public string UserPrincipalName {get; set;}
+
+ public List Emails {get; set;}
+
+ public string Photo {get; set;}
+
+ public MailSource Source
+ {
+ get => source;
+
+ set => source = value;
+ }
+ }
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GMailService.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GMailService.cs
index 416408588c..1f9a980a5a 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GMailService.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GMailService.cs
@@ -557,6 +557,28 @@ private MSMessage MapMimeMessageToMSMessage(MimeMessage mime)
message.ReplyTo = replyTo;
}
+ // Set importance
+ switch (mime.Importance)
+ {
+ case MessageImportance.Low:
+ message.Importance = Importance.Low;
+ break;
+ case MessageImportance.Normal:
+ message.Importance = Importance.Normal;
+ break;
+ case MessageImportance.High:
+ message.Importance = Importance.High;
+ break;
+ default:
+ break;
+ }
+
+ // Set attachment status
+ if (mime.Attachments != null && mime.Attachments.Count() > 0)
+ {
+ message.HasAttachments = true;
+ }
+
return message;
}
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GooglePeopleService.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GooglePeopleService.cs
index 5dd014f35a..9c56b6593e 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GooglePeopleService.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/GoogleAPI/GooglePeopleService.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
+using EmailSkill.Model;
using Google;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Auth.OAuth2.Flows;
@@ -13,9 +14,6 @@
using Google.Apis.Requests;
using Google.Apis.Services;
using Google.Apis.Util.Store;
-using Microsoft.Graph;
-using GooglePerson = Google.Apis.People.v1.Data.Person;
-using MsPerson = Microsoft.Graph.Person;
namespace EmailSkill.ServiceClients.GoogleAPI
{
@@ -26,6 +24,8 @@ public class GooglePeopleService : IUserService
{
private static PeopleService service;
+ private List cachedPeople;
+
///
/// Initializes a new instance of the class.
///
@@ -33,6 +33,7 @@ public class GooglePeopleService : IUserService
public GooglePeopleService(PeopleService peopleService)
{
service = peopleService;
+ cachedPeople = null;
}
public static PeopleService GetServiceClient(GoogleClient config, string token)
@@ -65,74 +66,128 @@ public static PeopleService GetServiceClient(GoogleClient config, string token)
return service;
}
- // To do: finish contact search
- public Task> GetContactsAsync(string name)
+ public Task> GetContactsAsync(string name)
{
- return Task.FromResult(new List());
+ return Task.FromResult(new List());
}
- // get people work with
- public async Task> GetPeopleAsync(string name)
+ public async Task GetMeAsync()
{
try
{
- PeopleResource.ConnectionsResource.ListRequest peopleRequest = service.People.Connections.List("people/me");
- peopleRequest.RequestMaskIncludeField = "person.emailAddresses,person.names";
+ var peopleRequest = service.People.Get("people/me");
+ peopleRequest.RequestMaskIncludeField = "person.emailAddresses,person.names,person.photos";
- ListConnectionsResponse connectionsResponse = await ((IClientServiceRequest)peopleRequest).ExecuteAsync();
- IList connections = connectionsResponse.Connections;
+ var me = await peopleRequest.ExecuteAsync();
+ if (me != null)
+ {
+ return new PersonModel(me);
+ }
- var result = new List();
- if (connections != null && connections.Count > 0)
+ return null;
+ }
+ catch (GoogleApiException ex)
+ {
+ throw GoogleClient.HandleGoogleAPIException(ex);
+ }
+ }
+
+ // get people work with
+ public async Task> GetPeopleAsync(string name)
+ {
+ try
+ {
+ List persons = null;
+ if (this.cachedPeople != null)
{
- foreach (var people in connections)
+ persons = this.cachedPeople;
+ }
+ else
+ {
+ persons = await GetGooglePeopleAsync();
+ }
+
+ List result = new List();
+ foreach (var person in persons)
+ {
+ // filter manually
+ var displayName = person.DisplayName;
+ if (person.Emails?.Count > 0 && displayName != null && displayName.ToLower().Contains(name.ToLower()))
{
- // filter manually
- var displayName = people.Names[0]?.DisplayName;
- if (people.EmailAddresses?.Count > 0 && displayName != null && displayName.ToLower().Contains(name.ToLower()))
- {
- result.Add(this.GooglePersonToMsPerson(people));
- }
+ result.Add(person);
}
}
+ this.cachedPeople = result;
return result;
}
catch (GoogleApiException ex)
{
throw GoogleClient.HandleGoogleAPIException(ex);
}
-}
+ }
+
+ public async Task GetPhotoAsync(string email)
+ {
+ List persons = null;
+ if (this.cachedPeople != null)
+ {
+ persons = this.cachedPeople;
+ }
+ else
+ {
+ persons = await GetGooglePeopleAsync();
+ }
+
+ foreach (var person in persons)
+ {
+ // filter manually
+ var displayName = person.DisplayName;
+ foreach (var personEmail in person.Emails)
+ {
+ if (email.Equals(personEmail))
+ {
+ return person.Photo;
+ }
+ }
+ }
+
+ return null;
+ }
// search people in domain
- public Task> GetUserAsync(string name)
+ public Task> GetUserAsync(string name)
{
- return Task.FromResult(new List());
+ return Task.FromResult(new List());
}
- private MsPerson GooglePersonToMsPerson(GooglePerson person)
+ private async Task> GetGooglePeopleAsync()
{
- var result = new MsPerson();
- if (person.Names?.Count > 0)
+ try
{
- result.GivenName = person.Names[0]?.GivenName;
- result.Surname = person.Names[0]?.FamilyName;
- result.DisplayName = person.Names[0]?.DisplayName;
- result.UserPrincipalName = person.Names[0]?.DisplayNameLastFirst;
- }
+ PeopleResource.ConnectionsResource.ListRequest peopleRequest = service.People.Connections.List("people/me");
+ peopleRequest.RequestMaskIncludeField = "person.emailAddresses,person.names,person.photos";
- if (person.EmailAddresses?.Count > 0)
- {
- var addresses = new List();
- foreach (var email in person.EmailAddresses)
+ ListConnectionsResponse connectionsResponse = await ((IClientServiceRequest)peopleRequest).ExecuteAsync();
+ IList connections = connectionsResponse.Connections;
+ List result = new List();
+ if (connections != null && connections.Count > 0)
{
- addresses.Add(new ScoredEmailAddress() { Address = email.Value });
+ foreach (var people in connections)
+ {
+ if (people != null)
+ {
+ result.Add(new PersonModel(people));
+ }
+ }
}
- result.ScoredEmailAddresses = addresses;
+ return result;
+ }
+ catch (GoogleApiException ex)
+ {
+ throw GoogleClient.HandleGoogleAPIException(ex);
}
-
- return result;
}
}
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/IUserService.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/IUserService.cs
index 2306ce525b..59ee7c254e 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/IUserService.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/IUserService.cs
@@ -5,6 +5,7 @@ namespace EmailSkill.ServiceClients
{
using System.Collections.Generic;
using System.Threading.Tasks;
+ using global::EmailSkill.Model;
using Microsoft.Graph;
public interface IUserService
@@ -14,20 +15,33 @@ public interface IUserService
///
/// The person's name.
/// A representing the result of the asynchronous operation.
- Task> GetPeopleAsync(string name);
+ Task> GetPeopleAsync(string name);
///
/// Get user from your organization.
///
/// The person's name.
/// A representing the result of the asynchronous operation.
- Task> GetUserAsync(string name);
+ Task> GetUserAsync(string name);
///
/// Get contacts from your organization.
///
/// The contact's name.
/// A representing the result of the asynchronous operation.
- Task> GetContactsAsync(string name);
+ Task> GetContactsAsync(string name);
+
+ ///
+ /// Get me.
+ ///
+ /// A representing the result of the asynchronous operation.
+ Task GetMeAsync();
+
+ ///
+ /// Get user photo from your organization.
+ ///
+ /// The user's email.
+ /// A representing the result of the asynchronous operation.
+ Task GetPhotoAsync(string email);
}
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/MSGraphAPI/MSGraphUserService.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/MSGraphAPI/MSGraphUserService.cs
index 23058286e5..a5eb276bcb 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/MSGraphAPI/MSGraphUserService.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/ServiceClients/MSGraphAPI/MSGraphUserService.cs
@@ -3,7 +3,11 @@
using System;
using System.Collections.Generic;
+using System.IO;
+using System.Net.Http;
using System.Threading.Tasks;
+using EmailSkill.Extensions;
+using EmailSkill.Model;
using Microsoft.Graph;
namespace EmailSkill.ServiceClients.MSGraphAPI
@@ -29,25 +33,146 @@ public MSGraphUserService(IGraphServiceClient serviceClient, TimeZoneInfo timeZo
this._timeZoneInfo = timeZoneInfo;
}
+ ///
+ /// search people by name.
+ ///
+ /// people's name.
+ /// List of People.
+ public async Task> GetPeopleAsync(string name)
+ {
+ List persons = await GetMSPeopleAsync(name);
+ List result = new List();
+ foreach (var person in persons)
+ {
+ if (person != null)
+ {
+ result.Add(new PersonModel(person));
+ }
+ }
+
+ return result;
+ }
+
///
/// GetUsersAsync.
///
/// name.
/// Task contains List of Users.
- public async Task> GetUserAsync(string name)
+ public async Task> GetUserAsync(string name)
{
- List items = new List();
+ List users = await GetMSUserAsync(name);
+ List result = new List();
+ foreach (User user in users)
+ {
+ if (user != null)
+ {
+ result.Add(new PersonModel(user.ToPerson()));
+ }
+ }
+
+ return result;
+ }
+
+ ///
+ /// GetContactAsync.
+ ///
+ /// name.
+ /// Task contains List of Contacts.
+ public async Task> GetContactsAsync(string name)
+ {
+ List contacts = await GetMSContactsAsync(name);
+ List result = new List();
+ foreach (Contact contact in contacts)
+ {
+ if (contact != null)
+ {
+ result.Add(new PersonModel(contact.ToPerson()));
+ }
+ }
+
+ return result;
+ }
+
+ public async Task GetMeAsync()
+ {
+ try
+ {
+ var me = await _graphClient.Me.Request().GetAsync();
+
+ if (me != null)
+ {
+ var url = await GetMSUserPhotoUrlAsyc(me.Id);
+ var personMe = new PersonModel(me.ToPerson());
+ personMe.Photo = url;
+
+ return personMe;
+ }
+
+ return null;
+ }
+ catch (ServiceException ex)
+ {
+ throw GraphClient.HandleGraphAPIException(ex);
+ }
+ }
+ public async Task GetPhotoAsync(string email)
+ {
+ var users = await this.GetUserAsync(email);
+
+ if (users != null && users.Count > 0 && users[0].Id != null)
+ {
+ return await GetMSUserPhotoUrlAsyc(users[0].Id);
+ }
+
+ return null;
+ }
+
+ private static byte[] ReadFully(Stream input)
+ {
+ using (MemoryStream ms = new MemoryStream())
+ {
+ input.CopyTo(ms);
+ return ms.ToArray();
+ }
+ }
+
+ private async Task GetMSUserPhotoUrlAsyc(string id)
+ {
+ var photoRequest = this._graphClient.Users[id].Photos["64x64"].Content.Request();
+
+ Stream originalPhoto = null;
+ string photoUrl = string.Empty;
+ try
+ {
+ originalPhoto = await photoRequest.GetAsync();
+ photoUrl = Convert.ToBase64String(ReadFully(originalPhoto));
+
+ return string.Format("data:image/jpeg;base64,{0}", photoUrl);
+ }
+ catch (ServiceException ex)
+ {
+ return null;
+ }
+ }
+
+ ///
+ /// GetUsersAsync.
+ ///
+ /// name.
+ /// Task contains List of Users.
+ private async Task> GetMSUserAsync(string name)
+ {
+ var items = new List();
var optionList = new List();
var filterString = $"startswith(displayName, '{name}') or startswith(givenName,'{name}') or startswith(surname,'{name}') or startswith(mail,'{name}') or startswith(userPrincipalName,'{name}')";
optionList.Add(new QueryOption("$filter", filterString));
- IGraphServiceUsersCollectionPage users = null;
-
// Get the current user's profile.
+ IGraphServiceUsersCollectionPage users = null;
try
{
- users = await this._graphClient.Users.Request(optionList).GetAsync();
+ users = await _graphClient.Users.Request(optionList).GetAsync();
}
catch (ServiceException ex)
{
@@ -56,10 +181,10 @@ public async Task> GetUserAsync(string name)
if (users?.Count > 0)
{
- foreach (User user in users)
+ foreach (var user in users)
{
// Filter out conference rooms.
- string displayName = user.DisplayName ?? string.Empty;
+ var displayName = user.DisplayName ?? string.Empty;
if (!displayName.StartsWith("Conf Room"))
{
// Get user properties.
@@ -77,35 +202,35 @@ public async Task> GetUserAsync(string name)
}
///
- /// search people by name.
+ /// Get people whose name contains specified word.
///
- /// people's name.
- /// List of People.
- public async Task> GetPeopleAsync(string name)
+ /// person name.
+ /// the persons list.
+ private async Task> GetMSPeopleAsync(string name)
{
- List items = new List();
+ var items = new List();
var optionList = new List();
var filterString = $"\"{name}\"";
optionList.Add(new QueryOption("$search", filterString));
- IUserPeopleCollectionPage users = null;
-
// Get the current user's profile.
+ IUserPeopleCollectionPage users = null;
try
{
- users = await this._graphClient.Me.People.Request(optionList).GetAsync();
+ users = await _graphClient.Me.People.Request(optionList).GetAsync();
}
catch (ServiceException ex)
{
throw GraphClient.HandleGraphAPIException(ex);
}
+ // var users = await _graphClient.Users.Request(optionList).GetAsync();
if (users?.Count > 0)
{
- foreach (Person user in users)
+ foreach (var user in users)
{
// Filter out conference rooms.
- string displayName = user.DisplayName ?? string.Empty;
+ var displayName = user.DisplayName ?? string.Empty;
if (!displayName.StartsWith("Conf Room"))
{
// Get user properties.
@@ -122,7 +247,7 @@ public async Task> GetPeopleAsync(string name)
///
/// name.
/// Task contains List of Contacts.
- public async Task> GetContactsAsync(string name)
+ private async Task> GetMSContactsAsync(string name)
{
List items = new List();
@@ -130,9 +255,8 @@ public async Task> GetContactsAsync(string name)
var filterString = $"startswith(displayName, '{name}') or startswith(givenName,'{name}') or startswith(surname,'{name}')";
optionList.Add(new QueryOption("$filter", filterString));
- IUserContactsCollectionPage contacts = null;
-
// Get the current user's profile.
+ IUserContactsCollectionPage contacts = null;
try
{
contacts = await this._graphClient.Me.Contacts.Request(optionList).GetAsync();
@@ -153,6 +277,11 @@ public async Task> GetContactsAsync(string name)
// Get user properties.
items.Add(contact);
}
+
+ if (items.Count >= 10)
+ {
+ break;
+ }
}
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/AdaptiveCardHelper.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/AdaptiveCardHelper.cs
new file mode 100644
index 0000000000..ecfc2640e5
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/AdaptiveCardHelper.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text.RegularExpressions;
+using AdaptiveCards;
+using Microsoft.Bot.Builder.Solutions.Responses;
+using Microsoft.Bot.Schema;
+using Newtonsoft.Json;
+
+namespace EmailSkill.Util
+{
+ public class AdaptiveCardHelper
+ {
+ public static readonly string DefaultAvatarIconPathFormat = "https://ui-avatars.com/api/?name={0}";
+
+ public static readonly string DefaultMe = "Me";
+
+ public static readonly int MaxDisplayRecipientNum = 5;
+
+ public static readonly string DefaultIcon = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==";
+
+ public static readonly string ImportantIcon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9InRpbnki%0D%0AIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhs%0D%0AaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIgoJIHg9IjBweCIgeT0iMHB4IiB2aWV3%0D%0AQm94PSIwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjQzUwRjFG%0D%0AIiBkPSJNMTAuNywxNi41di0xNWgzdjE1SDEwLjd6IE0xMC43LDIyLjV2LTNoM3YzSDEwLjd6Ii8+%0D%0ACjwvc3ZnPgo=";
+
+ public static readonly string AttachmentIcon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFk%0D%0Ab2JlIElsbHVzdHJhdG9yIDIzLjAuMiwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246%0D%0AIDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9InRpbnki%0D%0AIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhs%0D%0AaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIgoJIHg9IjBweCIgeT0iMHB4IiB2aWV3%0D%0AQm94PSIwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNzY3Njc2%0D%0AIiBkPSJNMTguMSw0LjV2MTQuMmMwLDAuNy0wLjEsMS40LTAuNCwyUzE3LDIyLDE2LjUsMjIuNXMt%0D%0AMSwwLjgtMS43LDEuMXMtMS4zLDAuNC0yLDAuNHMtMS40LTAuMS0yLTAuNAoJUzkuNiwyMyw5LjEs%0D%0AMjIuNXMtMC44LTEtMS4xLTEuN3MtMC40LTEuMy0wLjQtMnYtMTVjMC0wLjUsMC4xLTEsMC4zLTEu%0D%0ANXMwLjUtMC44LDAuOC0xLjJzMC43LTAuNiwxLjItMC44UzEwLjgsMCwxMS4zLDAKCXMxLDAuMSwx%0D%0ALjUsMC4zczAuOCwwLjUsMS4yLDAuOHMwLjYsMC43LDAuOCwxLjJzMC4zLDAuOSwwLjMsMS41djE1%0D%0AYzAsMC4zLTAuMSwwLjYtMC4yLDAuOXMtMC4zLDAuNS0wLjUsMC43cy0wLjQsMC40LTAuNywwLjUK%0D%0ACVMxMy4yLDIxLDEyLjgsMjFTMTIuMiwyMSwxMiwyMC45cy0wLjUtMC4zLTAuNy0wLjVzLTAuNC0w%0D%0ALjQtMC41LTAuN3MtMC4yLTAuNi0wLjItMC45VjZoMS41djEyLjdjMCwwLjIsMC4xLDAuNCwwLjIs%0D%0AMC41CglzMC4zLDAuMiwwLjUsMC4yczAuNC0wLjEsMC41LTAuMnMwLjItMC4zLDAuMi0wLjV2LTE1%0D%0AYzAtMC4zLTAuMS0wLjYtMC4yLTAuOXMtMC4zLTAuNS0wLjUtMC43cy0wLjQtMC40LTAuNy0wLjVz%0D%0ALTAuNi0wLjItMC45LTAuMgoJcy0wLjYsMC4xLTAuOSwwLjJTOS45LDIsOS43LDIuMlM5LjQsMi42%0D%0ALDkuMywyLjlTOS4xLDMuNSw5LjEsMy44djE1YzAsMC41LDAuMSwxLDAuMywxLjVzMC41LDAuOCww%0D%0ALjgsMS4yczAuNywwLjYsMS4yLDAuOAoJczAuOSwwLjMsMS41LDAuM3MxLTAuMSwxLjUtMC4zczAu%0D%0AOC0wLjUsMS4yLTAuOHMwLjYtMC43LDAuOC0xLjJzMC4zLTAuOSwwLjMtMS41VjQuNUgxOC4xeiIv%0D%0APgo8L3N2Zz4K";
+ }
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/DisplayHelper.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/DisplayHelper.cs
index 8dd98ad9a8..8d10801c31 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/DisplayHelper.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/DisplayHelper.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using EmailSkill.Dialogs.Shared.Resources.Strings;
+using EmailSkill.Model;
using Microsoft.Bot.Builder.Solutions.Resources;
using Microsoft.Graph;
@@ -57,20 +58,20 @@ public static string ToDisplayRecipientsString(IEnumerable recipients
return displayString;
}
- public static (List formattedPersonList, List formattedUserList) FormatRecipientList(List personList, List userList)
+ public static (List formattedPersonList, List formattedUserList) FormatRecipientList(List personList, List userList)
{
// Remove dup items
- List formattedPersonList = new List();
- List formattedUserList = new List();
+ List formattedPersonList = new List();
+ List formattedUserList = new List();
foreach (var person in personList)
{
- var mailAddress = person.ScoredEmailAddresses.FirstOrDefault()?.Address ?? person.UserPrincipalName;
+ var mailAddress = person.Emails?[0] ?? person.UserPrincipalName;
bool isDup = false;
foreach (var formattedPerson in formattedPersonList)
{
- var formattedMailAddress = formattedPerson.ScoredEmailAddresses.FirstOrDefault()?.Address ?? formattedPerson.UserPrincipalName;
+ var formattedMailAddress = formattedPerson.Emails?[0] ?? formattedPerson.UserPrincipalName;
if (mailAddress.Equals(formattedMailAddress, StringComparison.OrdinalIgnoreCase))
{
@@ -87,12 +88,12 @@ public static (List formattedPersonList, List formattedUserList)
foreach (var user in userList)
{
- var mailAddress = user.ScoredEmailAddresses.FirstOrDefault()?.Address ?? user.UserPrincipalName;
+ var mailAddress = user.Emails?[0] ?? user.UserPrincipalName;
bool isDup = false;
foreach (var formattedPerson in formattedPersonList)
{
- var formattedMailAddress = formattedPerson.ScoredEmailAddresses.FirstOrDefault()?.Address ?? formattedPerson.UserPrincipalName;
+ var formattedMailAddress = formattedPerson.Emails?[0] ?? formattedPerson.UserPrincipalName;
if (mailAddress.Equals(formattedMailAddress, StringComparison.OrdinalIgnoreCase))
{
@@ -105,7 +106,7 @@ public static (List formattedPersonList, List formattedUserList)
{
foreach (var formattedUser in formattedUserList)
{
- var formattedMailAddress = formattedUser.ScoredEmailAddresses.FirstOrDefault()?.Address ?? formattedUser.UserPrincipalName;
+ var formattedMailAddress = formattedUser.Emails?[0] ?? formattedUser.UserPrincipalName;
if (mailAddress.Equals(formattedMailAddress))
{
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/Util.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/Util.cs
new file mode 100644
index 0000000000..c430aa4b21
--- /dev/null
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskill/Util/Util.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace EmailSkill.Util
+{
+ public class Util
+ {
+ public static bool IsEmail(string email)
+ {
+ if (string.IsNullOrWhiteSpace(email))
+ {
+ return false;
+ }
+
+ // Match email address, e.g. a@b.com
+ return Regex.IsMatch(email, @"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$");
+ }
+ }
+}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Helper/StepHelperTests.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Helper/StepHelperTests.cs
index 93bf541a0b..b072f55d7c 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Helper/StepHelperTests.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Helper/StepHelperTests.cs
@@ -2,6 +2,7 @@
using System.Threading.Tasks;
using EmailSkill;
using EmailSkill.Dialogs.Shared;
+using EmailSkill.Model;
using EmailSkill.Util;
using EmailSkillTest.API.Fakes;
using Microsoft.Graph;
@@ -90,8 +91,8 @@ public void FormatRecipientListTest()
var contactData = GetPersonLists(1, 6);
personData.AddRange(contactData);
- List originPersonList = personData;
- List originUserList = GetPersonLists(2, 7);
+ List originPersonList = personData;
+ List originUserList = GetPersonLists(2, 7);
(var personList, var userList) = DisplayHelper.FormatRecipientList(originPersonList, originUserList);
@@ -120,23 +121,19 @@ private List GetRecipients(int count)
return result;
}
- private List GetPersonLists(int start, int end)
+ private List GetPersonLists(int start, int end)
{
- List result = new List();
+ List result = new List();
for (int i = start; i < end; i++)
{
- var emailList = new List();
- var scoredEmailAddress = new ScoredEmailAddress
- {
- Address = "test" + i.ToString() + "@test.com"
- };
- emailList.Add(scoredEmailAddress);
+ var emailList = new List();
+ emailList.Add("test" + i.ToString() + "@test.com");
- var person = new Person
+ var person = new PersonModel
{
DisplayName = "test" + i.ToString(),
- ScoredEmailAddresses = emailList
+ Emails = emailList
};
result.Add(person);
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GoogleUserServiceTests.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GoogleUserServiceTests.cs
index 89e00b897d..3b9e1eb0a7 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GoogleUserServiceTests.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GoogleUserServiceTests.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
+using EmailSkill.Model;
using EmailSkill.ServiceClients;
using EmailSkill.ServiceClients.GoogleAPI;
using EmailSkillTest.API.Fakes.Google;
@@ -37,21 +38,21 @@ public void TestCleanup()
[TestMethod]
public async Task GetPeopleAsyncTest()
{
- List result = await UserService.GetPeopleAsync("Doe");
+ List result = await UserService.GetPeopleAsync("Doe");
Assert.IsTrue(result.Count == 2);
}
[TestMethod]
public async Task GetUserAsyncTest()
{
- List result = await UserService.GetUserAsync("Doe");
+ List result = await UserService.GetUserAsync("Doe");
Assert.IsTrue(result.Count == 0);
}
[TestMethod]
public async Task GetContactsAsyncTest()
{
- List result = await UserService.GetContactsAsync("Doe");
+ List result = await UserService.GetContactsAsync("Doe");
Assert.IsTrue(result.Count == 0);
}
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GraphUserServiceTests.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GraphUserServiceTests.cs
index 80e78f84df..a009a629d7 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GraphUserServiceTests.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/API/Service/GraphUserServiceTests.cs
@@ -140,7 +140,7 @@ public async Task GetContactsTest()
var result = await userService.GetContactsAsync("test");
- Assert.IsTrue(result.Count == 12);
+ Assert.IsTrue(result.Count == 10);
// "Conf Room" is filtered
foreach (var user in result)
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/EmailSkillTest.csproj b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/EmailSkillTest.csproj
index 512ea27613..cbbd7a98a0 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/EmailSkillTest.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/EmailSkillTest.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/Fakes/MockUserService.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/Fakes/MockUserService.cs
index 3093bc79d9..ff9e30e4d0 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/Fakes/MockUserService.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/Fakes/MockUserService.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
+using EmailSkill.Model;
using EmailSkill.ServiceClients;
using Microsoft.Graph;
@@ -14,15 +15,15 @@ public MockUserService()
this.Contacts = FakeContacts();
}
- public List People { get; set; }
+ public List People { get; set; }
- public List Users { get; set; }
+ public List Users { get; set; }
- public List Contacts { get; set; }
+ public List Contacts { get; set; }
- public Task> GetPeopleAsync(string name)
+ public Task> GetPeopleAsync(string name)
{
- var result = new List();
+ var result = new List();
foreach (var person in this.People)
{
@@ -35,9 +36,9 @@ public Task> GetPeopleAsync(string name)
return Task.FromResult(result);
}
- public Task> GetUserAsync(string name)
+ public Task> GetUserAsync(string name)
{
- var result = new List();
+ var result = new List();
foreach (var user in this.Users)
{
@@ -50,9 +51,9 @@ public Task> GetUserAsync(string name)
return Task.FromResult(result);
}
- public Task> GetContactsAsync(string name)
+ public Task> GetContactsAsync(string name)
{
- var result = new List();
+ var result = new List();
foreach (var contact in this.Contacts)
{
@@ -65,47 +66,47 @@ public Task> GetContactsAsync(string name)
return Task.FromResult(result);
}
- private List FakePeople()
+ private List FakePeople()
{
- var people = new List();
+ var people = new List();
- var addressList = new List();
- var emailAddress = new ScoredEmailAddress()
- {
- Address = "test@test.com",
- RelevanceScore = 1,
- };
- addressList.Add(emailAddress);
+ var emailAddressStr = "test@test.com";
+ var mails = new List();
+ mails.Add(emailAddressStr);
- people.Add(new Person()
+ people.Add(new PersonModel()
{
UserPrincipalName = "test@test.com",
- ScoredEmailAddresses = addressList,
+ Emails = mails,
DisplayName = "Test Test",
});
return people;
}
- private List FakeUsers(int dupSize = 5)
+ private List FakeUsers(int dupSize = 5)
{
- var users = new List();
+ var users = new List();
var emailAddressStr = "test@test.com";
- users.Add(new User()
+ var mails = new List();
+ mails.Add(emailAddressStr);
+ users.Add(new PersonModel()
{
UserPrincipalName = emailAddressStr,
- Mail = emailAddressStr,
+ Emails = mails,
DisplayName = "Test Test",
});
for (int i = 0; i < dupSize; i++)
{
emailAddressStr = "testdup" + i + "@test.com";
- users.Add(new User()
+ var emails = new List();
+ emails.Add(emailAddressStr);
+ users.Add(new PersonModel()
{
UserPrincipalName = emailAddressStr,
- Mail = emailAddressStr,
+ Emails = emails,
DisplayName = "TestDup Test",
});
}
@@ -113,24 +114,38 @@ private List FakeUsers(int dupSize = 5)
return users;
}
- private List FakeContacts()
+ private List FakeContacts()
{
- var contacts = new List();
+ var contacts = new List();
- var addressList = new List();
- var emailAddress = new EmailAddress()
- {
- Address = "test@test.com",
- };
- addressList.Add(emailAddress);
+ var addressList = new List();
+ addressList.Add("test@test.com");
- contacts.Add(new Contact()
+ contacts.Add(new PersonModel()
{
- EmailAddresses = addressList,
+ Emails = addressList,
DisplayName = "Test Test",
});
return contacts;
}
+
+ public Task GetMeAsync()
+ {
+ var addressList = new List();
+ addressList.Add("test@test.com");
+ var user = new PersonModel()
+ {
+ UserPrincipalName = "Test Test",
+ Emails = addressList,
+ DisplayName = "Test Test",
+ };
+ return Task.FromResult(user);
+ }
+
+ public Task GetPhotoAsync(string id)
+ {
+ return Task.FromResult("data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==");
+ }
}
}
\ No newline at end of file
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/ShowEmailFlowTests.cs b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/ShowEmailFlowTests.cs
index f9607c7bc4..f4c9d9375b 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/ShowEmailFlowTests.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/emailskill/emailskilltest/Flow/ShowEmailFlowTests.cs
@@ -516,7 +516,6 @@ private Action ShowEmailList(int expectCount = 3, int page = 0)
});
CollectionAssert.Contains(replies, messageActivity.Text);
- Assert.AreEqual(messageActivity.Attachments.Count, expectCount);
}
};
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/PointOfInterestSkillDialog.cs b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/PointOfInterestSkillDialog.cs
index 3e04082b8c..e94f73b49e 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/PointOfInterestSkillDialog.cs
+++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/Dialogs/Shared/PointOfInterestSkillDialog.cs
@@ -424,7 +424,7 @@ protected async Task> GetPointOfInterestLocationCards
var templateId = POISharedResponses.SingleLocationFound;
var card = new Card("PointOfInterestDetails", state.LastFoundPointOfInterests[0]);
- var replyMessage = ResponseManager.GetCardResponse(templateId, card);
+ var replyMessage = ResponseManager.GetCardResponse(templateId, card, tokens: null);
replyMessage.Speak = ResponseUtility.BuildSpeechFriendlyPoIResponse(replyMessage);
await sc.Context.SendActivityAsync(replyMessage);
@@ -598,7 +598,7 @@ protected async Task GetRouteDirectionsViewCards(DialogContext sc, RouteDirectio
else
{
var card = new Card("PointOfInterestDetailsWithRoute", cardData.SingleOrDefault());
- var replyMessage = ResponseManager.GetCardResponse(POISharedResponses.SingleRouteFound, card);
+ var replyMessage = ResponseManager.GetCardResponse(POISharedResponses.SingleRouteFound, card, tokens: null);
replyMessage.Speak = ResponseUtility.BuildSpeechFriendlyPoIResponse(replyMessage);
await sc.Context.SendActivityAsync(replyMessage);
}
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/PointOfInterestSkill.csproj b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/PointOfInterestSkill.csproj
index 3ffb003a29..6dcb59dab2 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/PointOfInterestSkill.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskill/PointOfInterestSkill.csproj
@@ -24,7 +24,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/PointOfInterestSkillTests.csproj b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/PointOfInterestSkillTests.csproj
index cc04efcc2a..1ec7024ecd 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/PointOfInterestSkillTests.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/pointofinterestskill/pointofinterestskilltests/PointOfInterestSkillTests.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskill/ToDoSkill.csproj b/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskill/ToDoSkill.csproj
index 3e072b91ca..2a5540c2f4 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskill/ToDoSkill.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskill/ToDoSkill.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskilltest/ToDoSkillTest.csproj b/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskilltest/ToDoSkillTest.csproj
index 6582bd712d..a3ba00aaa2 100644
--- a/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskilltest/ToDoSkillTest.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/skills/todoskill/todoskilltest/ToDoSkillTest.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/tests/experimental.skills.tests/Experimental.Skills.Tests.csproj b/solutions/Virtual-Assistant/src/csharp/tests/experimental.skills.tests/Experimental.Skills.Tests.csproj
index dbf3b9cd38..389ede3eff 100644
--- a/solutions/Virtual-Assistant/src/csharp/tests/experimental.skills.tests/Experimental.Skills.Tests.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/tests/experimental.skills.tests/Experimental.Skills.Tests.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/solutions/Virtual-Assistant/src/csharp/tests/virtualassistant.tests/VirtualAssistant.Tests.csproj b/solutions/Virtual-Assistant/src/csharp/tests/virtualassistant.tests/VirtualAssistant.Tests.csproj
index c0c1bb400d..196dafdb4d 100644
--- a/solutions/Virtual-Assistant/src/csharp/tests/virtualassistant.tests/VirtualAssistant.Tests.csproj
+++ b/solutions/Virtual-Assistant/src/csharp/tests/virtualassistant.tests/VirtualAssistant.Tests.csproj
@@ -8,7 +8,7 @@
-
+