Can I customize the alert emails sent from Azure Application Insights ? - email

I have a couple apps using ONE and when there is an exception it is not shown in the email specifically which app is causing the problem. Is there some way to add info to the email ? I have the info in the exception . I just need it to appear in the email
public void TrackNonFatalExceptions(Exception ex)
{
var dictExceptionProperties = new Dictionary<string, string> { { "App", "EncompassRequestDocs" } };
_telemetryClient.TrackException(ex, dictExceptionProperties, null);
}

There's no way to customize the mails right now.
There's a uservoice suggestion here:
https://visualstudio.uservoice.com/forums/357324-application-insights/suggestions/5894710-application-insights-daily-weekly-monthly-digest
which might cover what you want.
more likely what you want/need is a way to query your own data programatically and generate the data however you want, in mail/dashboard/etc, which would be covered by a separate planned suggestion here:
https://visualstudio.uservoice.com/forums/357324-application-insights/suggestions/4999529

Related

Ionic 4 + WhatsApp share - Get receiver / contact details after I share my message

I am using Ionic 4 + SocialSharing-PhoneGap-Plugin.
After I share a message with my contact, how can I get back the contact's name/number and other info back in the promise, so that I can save it in the database?
I have the following code:
import { SocialSharing } from '#ionic-native/social-sharing/ngx';
constructor(private socialSharing: SocialSharing) { }
// Share message via WhatsApp
this.socialSharing.shareViaWhatsApp('Hi', null, null).then(() => {
// How to get the contact's details here, with whom
// I shared my message? Would like to get the name, number
// and all other contact info.
// Following Toast does not seem to trigger
this.toastService.presentToast('Successfully shared coupon on WhatsApp', 'success');
}).catch(() => {
// Sharing via WhatsApp is not possible. How to trigger a toast here as well?
});
How can I show a toast message immediately after return, so that I know that the message was shared successfully? As can be seen from the code, I have a toastService that shows the toast, but it never gets triggered. How can I trigger the toast after successfully sharing my message on WhatsApp, both in success & error cases?
To access contacts, you'll need a separate plugin like Contacts -- maybe get the contact first using that plugin and then use shareViaWhatsAppToPhone to share directly to that number.
The toast should work. From your example, it doesn't look like you've injected the ToastService into the class.

how to respond to user using google assistant after the conversation is ended?

I am making a google action.I have one scenario where calculation requires some time in cloud fulfillment but i don't want to keep user waiting for answer.
I want to respond to user whenever my answer is ready even when conversation with user is ended i want to send my answer in notification or something like that.
I just found this on google actions documents.
https://developers.google.com/actions/assistant/updates
Is this possible in google actions and how?
What you mean here is notifications. You can use it but please pay attention to the warning at the top of the link you provided: "Updates and notifications are currently in Developer Preview. You can build apps using the features described in this article, but you can't currently publish them".
As for the steps to crated a daily notification:
Navigate to your actions.intent.CONFIGURE_UPDATES intent.
Under Responses, go to the Google Assistant tab, click Add Message Content, and select Custom Payload.
In the "Custom Payload" box, add the following code to call the AskToRegisterDailyUpdate helper. Swap INTENT_NAME to the intent that you want to be invoked when the user interacts with your notification.
{
"google": {
"system_intent": {
"intent": "actions.intent.REGISTER_UPDATE",
"data": {"#type": "type.googleapis.com/google.actions.v2.RegisterUpdateValueSpec",
"intent": "INTENT_NAME",
"triggerContext": {
"timeContext": { "frequency": "DAILY" }
}
}
}
}
}
If using a webhook, you can call this API directly via the client library:
appMap.set('setup_update', function(app) {
app.askToRegisterDailyUpdate('INTENT_NAME');
})
})
Add one more intent called "finish_update_setup" and enter actions_intent_REGISTER_UPDATE as its Event.
Set the intent's Action to "finish_update_setup" as well.
In your webhook, open index.js and add the following. Replace Ok, I'll start giving you daily updates and Ok, I won't give you daily updates. with whatever response you want to give the user:
appMap.set('finish_update_setup', function(app)) {
if (app.isUpdateRegistered()) {
app.tell("Ok, I'll start giving you daily updates.");
} else {
app.tell("Ok, I won't give you daily updates.");
}
}
Deploy the webhook to Firebase Functions and enable webhook fulfillment in Dialogflow.
If you want to see how to create a simple notification (not daily one) - please check this doc on push notifications.
If you don't have an immediate reply to send but expect one soon-ish what you do is return a "promise". When you are in a position to reply, "fulfilling" the promise causes your reply to be delivered. I don't know what the actual timeout is but in my case I'm pretty sure at least a few second delay is allowed.
As for the updates or notifications, the API is there but the docs say you can't deploy an Action to production using them. There is a slightly cryptic comment to "contact support" if you need them.
One of these days I might try.

How can we dynamically populate quick replies of facebook messenger from a JSON object?

I really liked the Facebook quick replies feature which helps us guide the conversation with the user.
My context is I am building a form fill bot. There are a few questions a user is asked before he is redirected to the appropriate page. The questions and their options come as a JSON object.
I would like to make the question as a text message and the options as quick replies. This would greatly help the user quickly answer the few questions and get the form filled.
I am stuck at the point where I need to populate the quick replies options with the questions' options.
I am using Microsoft Bot builder framework to build the bot
Channel's specific features (such as the Quick Replies from Facebook) are supported through the ChannelData (C#) / sourceEvent (Node) fields. So you need to send the specific info through it so Facebook can understand it and react accordingly.
Here is a quick example showing how to send Facebook's Quick Replies.
var channelData = JObject.FromObject(new
{
quick_replies = new dynamic[]
{
new
{
content_type = "text",
title = "Blue",
payload = "DEFINED_PAYLOAD_FOR_PICKING_BLUE",
image_url = "https://cdn3.iconfinder.com/data/icons/developperss/PNG/Blue%20Ball.png"
},
new
{
content_type = "text",
title = "Green",
payload = "DEFINED_PAYLOAD_FOR_PICKING_GREEN",
image_url = "https://cdn3.iconfinder.com/data/icons/developperss/PNG/Green%20Ball.png"
},
new
{
content_type = "text",
title = "Red",
payload = "DEFINED_PAYLOAD_FOR_PICKING_RED",
}
}
});
reply.ChannelData = channelData;
You can also find more details about how to use new Facebook's features with BotFramework in this blog post.
Please note that in the particular case of Quick Replies, the BotFramework team is adding support to them in the library. The commit is still in the develop branch; so it's not yet public (you can still build the library and reference to that instead of the public NuGet)

Opening mailto: links from webview

Just want to start off by saying I'm not a much of a Java dev or anything of an Android dev. The links I've found on SO for solving my issue aren't specific to WL, and I'm not sure where to place the 'solutions' in the build.
I've got simple email link to start this:
In Android (4.0.4) the app will crash saying it's not a supported protocol. That much is expected.
One of the solutions I have (below, from SO, lost the link) seems like the right way to go, but I'm not sure where this is supposed to go.
#Override
public boolean shouldOverrideUrlLoading(WebViewClient view, String url) {
if( url.startsWith("http:") || url.startsWith("https:") ) {
return false;
}
// Otherwise allow the OS to handle it
else if (url.startsWith("tel:")) {
Intent tel = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(tel);
return true;
}
else if (url.startsWith("mailto:")) {
String body = "Enter your Question, Enquiry or Feedback below:\n\n";
Intent mail = new Intent(Intent.ACTION_SEND);
mail.setType("application/octet-stream");
mail.putExtra(Intent.EXTRA_EMAIL, new String[]{"email address"});
mail.putExtra(Intent.EXTRA_SUBJECT, "Subject");
mail.putExtra(Intent.EXTRA_TEXT, body);
startActivity(mail);
return true;
}
return true;
}
Any help is obviously greatly appreciated!
In a Worklight hybrid application, you are not required to use native code in order to use features such as mailto:.
To get it working, i.e: to click a link that will open the email screen for the user to fill in the subject and message, you can follow the below. If you need greater functionality, elaborate on it in your question:
Make sure you are using the latest iFix available for the version of Worklight that you are using (due to recently fixed Cordova security bugs that affect this functionality). This can be obtained from either the Eclipse Marketplace or IBM Fix Central.
Follow these steps:
In native\res\xml\config.xml, remove and add the following lines:
- <access origin="*"/>
+ <access origin="mailto://*" launch-external="true" />
In common\index.html I then tried with:
Send email
The result was (depending on your phone setup): either to get an option to set up an email account, select from which account to send the mail to, or get the email compose screen.

Share TEXT to Google+?

I'd like to allow my website (which allows users to post to the website itself, and, if the user enables it, Facebook) to be able to share a user's post to Google+. After reading through all I could find on stackoverflow/etc., it seems that the official G+ API doesn't allow you to post anything to a user's stream. That means that I'd have to use a share button/link/etc. The problem is, every share button/link I've found is for sharing _url_s...but I want to share text (and maybe an added URL if necessary)! If there's already a question answering this, sorry for reposting, but it must've gotten hidden beneath the ~ 5,000 questions that got returned for my search :D
Thanks,
Matthew
The Share API is intended for sharing pages, although you could share a page and have the Snippet data on that page contain the text that you want to share.
You may also want to look into the History API, which is currently in developer preview, to see if it will meet your needs or to provide feedback to Google about what changes you might need.
You may post a message like this..
whether G+ app is installed in your phone or not
try it, this works for me
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
shareMediaButton = (Button) findViewById(R.id.share_button);
shareMediaButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
if(isGooglePlusInstalled())
{
PlusShare.Builder share = new PlusShare.Builder(MainActivity.this);
share.setText("write your message here.....!");
//share.addStream(selectedImage);
share.setType("text/plain");
startActivityForResult(share.getIntent(), 0);
}else{
Intent shareIntent = new PlusShare.Builder(MainActivity.this)
.setType("text/plain")
.setText("write your message here.....!")
.getIntent();
startActivityForResult(shareIntent, 0);
}
}
public boolean isGooglePlusInstalled()
{
try
{
getPackageManager().getApplicationInfo("com.google.android.apps.plus", 0 );
return true;
}
catch(PackageManager.NameNotFoundException e)
{
return false;
}
}
});
}