I am developing Push Notifications. Now I want to send an image along with the notification. How should I do it? Please help me.
My toast notification is:
"<toast launch=\"/text to receive\">" + "<visual>" +
" <binding template=\"ToastText02\">" + "<text id=\"1\">" +
Headertext +"</text>" + " <text id=\"2\">"+Message+"</text>" +
" </binding>" + " </visual>" + "</toast>"
Thanks in advance
You have different templates depending on the content you want to send.
Here you have some examples of templates you can use: https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.notifications.toasttemplatetype
In this page you can see the xaml code you should use with each one of those templates: http://www.getcodesamples.com/src/149C1734/36315A36
Change the text within binding tag to <binding template="ToastImageAndText02"><image id="1" src=""/><text id="1"></text><text id="2"></text></binding>
Related
I have a style in App.xaml like below
<Style TargetType="TextBlock" x:Key="Styletext">
<Setter Property="Fontsize" Value="13"/></Style>
And in the mainpage.xaml. I have
<TextBlock Content="ABC" Style={StaticResource Styletext/>
And 2 Button Aa-,Aa+ To Up size for that textblock. So Question is: How I can get Value from Property"Fontsize" and + or - it and Modify Style to Assign for TextBlock. Tks All
You can not change the style in static resource. For your requirement, you can considering setting the style of TextBlock in code behind.
For example:
var dynamicStyle = new Windows.UI.Xaml.Style();
var targetType = typeof(Windows.UI.Xaml.Controls.TextBlock);
dynamicStyle.TargetType = targetType;
dynamicStyle.Setters.Add(new Setter(Windows.UI.Xaml.Controls.TextBlock.FontSizeProperty, text01.FontSize + 1));
text01.Style = dynamicStyle;
I have the following string value generated in the controller.
cc.lstchat = "Reply the Number with your question... <br />";
foreach (clsChat item in lstchat)
{
cc.lstchat =cc.lstchat + item.DisplayNumber+". " + item.ChatItem+" <br/> ";
}
Now i'm trying to display above string value inside a div tag in my view but it does not render the line breaks.
<div id="divChat" style="width:400px;height:300px;border:double">
#Model.lstchat.ToString()
</div>
Try the #Html.Raw method
#Html.Raw(Model.lstchat)
Use Html.Raw() it is used to render any string as HTML.
`#Html.Raw("input data in here is rendered as HTML only")`
please please be careful with #Html.Raw() because of HTML injection (eg my comment will be <script>...</script> test - that an XSS right away. If you just want line breaks - consider this answer:
#Html.Raw(Html.Encode(Model.CommentText).Replace("\n", "<br />"))
Using a Custom HTML module and have the following code:
<h2>info#studev.net</h2>
However after saving the module, the rendered code becomes:
<h2>
<script type="text/javascript">
<!--
var prefix = 'ma' + 'il' + 'to';
var path = 'hr' + 'ef' + '=';
var addy61999 = 'info' + '#';
addy61999 = addy61999 + 'studev' + '.' + 'net';
var addy_text61999 = 'info' + '#' + 'studev' + '.' + 'net';
document.write('<a ' + path + '\'' + prefix + ':' + addy61999 + '\'>');
document.write(addy_text61999);
document.write('<\/a>');
//-->\n </script>info#studev.net<script type="text/javascript">
<!--
document.write('<span style=\'display: none;\'>');
//-->
</script><span style="display: none;">This email address is being protected from spambots. You need JavaScript enabled to view it.
<script type="text/javascript">
<!--
document.write('</');
document.write('span>');
//-->
</script></span></h2>
Does anyone know why this is happening?
It is 'Content - Email Cloaking' plugin for protection email in joomla. This plugin changes each email in such way (with js). If you want, you can disable this plugin. But If you found such code with js in source of page it is normal.
/libraries/joomla/html/html/email.php - rule for 'email cloaking'
For anyone else trying to add attributes to anchors that are filtered by the Email Cloaking plugin, you can use this piece of jQuery to add your own attributes after the page has loaded:
HTML Example:
<h2 id="contactUsEmail">info#studev.net</h2>
You cannot put the ID in the anchor tag as the plugin removes this as it renders the page, so use the parent tags and then use ">" to identify a child element, in this case an anchor tag, as so:
jQuery(document).ready(function(){
$("#contactUsEmail > a").attr("target","_blank");
});
This target="_blank" to the anchor link, after the page has loaded, but keeping the Email Cloaking plugin still enabled
below is my google apps script to display HTML form in the mail to the client and fetching response via web-service. this works fine when my client is using Gmail account and form is displaying perfectly nice and also all the events are working correctly. but the problem occurs when my client tries this same with outlook account the <textarea>, <button> (these tags are not displaying). Can anyone tell me what's the problem? for outlook account is there any more settings we need to do?
function sendAutoReply(e)
{
var myemail = "viral.shah#searce.com";
var email = "";
var subject = "Your Request Status Message..";
var html =
'<body>' +
'<table border="1">'+
'<tr>'+
'<td>'+
'<label> Comment </label>'+'<br>'+'<br>'+
'</td>'+
'</tr>'+
'<tr>'+
'<td>'+
'<textarea rows="5" cols="100"/>'+'<br>'+'<br>'+
'</td>'+
'</tr>'+
'<tr>'+
'<td>'+
'<input type="button" value="accept"/>' +
'</td>'+
'<td>'+
'<input type = "button" value = "Decline"/>'+
'</td>'+
'</tr>'+
'</table>'+
'</body>';
try {
for(var field in e.namedValues) {
if (field == 'Subject') {
subject += e.namedValues[field].toString();
}
if (field == 'Email') {
email = e.namedValues[field].toString();
}
html += field + ' : '
+ e.namedValues[field].toString() + "\n\n";
}
MailApp.sendEmail(email, subject, html, {replyTo:myemail, htmlBody:html});
}
catch(e){
MailApp.sendEmail(myemail, "Error in Auto replying to contact form submission. No reply was sent.", e.html);
}
}
Thanks in Advance :)
Outlook doesn't support the <button> tag:
The HTML tags that Outlook supports
Try using <input type="button"> instead of and it should work.
As for <textarea>, it's technically supported, but there appear to be lots of people who complain about it not working. That document says in one place that it supports the "cols" attribute and in another place that it does not, so try removing that perhaps. Also, Outlook is finicky enough about HTML that I'd try explicit closing tags like <textarea></textarea> instead of the shorthand style.
No, I'm telling it won't support any HTML tags into outlook email client
Please Go through this Forum Link
And this MSDN link
I think these articles will make clear thoughts about this.
for outlook 2007 mail client not displaying forms there. so, this one is not possible in outlook mail client. check the given link.
Hope this one helps you.
If the button action is simple enough that can be equivalent to visiting an url, you can add a message like the following:
Confirm email through this link if confirm button is unavailable
https://www.example.com/confirm/av87hfua7ImAToken4vf8a98jao5ia
Those who see the button will also see this sentence, but since this is a fairly common practice it won't cause much noise.
Following is my html content which i want to show in the webview using android sdk. It will displays only
//Please
But when I put this HTML content into the browser then it shows differently.
<br /><br />Read the handouts please for tomorrow.<br /><br /><!--homework help homework
help help with homework homework assignments elementary school high school middle school
// --><font color="#60c000" size="4"><strong>Please!</strong></font>
Please suggest how to resolve this problem
I have another problem that in HTML content there is a tag
<img src="http://www.homeworknow.com/hwnow/upload/images/tn_star300.gif" border="0" />
in this images does not shows.
Use web.loadDataWithBaseURL instead of web.loadData (And don't forget to escape strings where it's needed)
You need to add internet permission to download images and view them in your manifest file.
This example works for me:
public class SimpleMusicStream extends Activity {
#Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
WebView wv = (WebView) findViewById(R.id.WebView01);
final String mimeType = "text/html";
final String encoding = "UTF-8";
String html = "<br /><br />Read the handouts please for tomorrow.<br /><br /><!--homework help homework" +
"help help with homework homework assignments elementary school high school middle school" +
"// --><font color='#60c000' size='4'><strong>Please!</strong></font>" +
"<img src='http://www.homeworknow.com/hwnow/upload/images/tn_star300.gif' />";
wv.loadDataWithBaseURL("", html, mimeType, encoding, "");
}
}
And don't forget to add:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
in your AndroidManifest.xml file
Either you can do it as above or put html file into the asset folder and the use it loke this to display it
view.loadUrl("file:///android_asset/FILENAME.html");
for image display you can do it like
String str= " img src=\"http://www.homeworknow.com/hwnow/upload/images/tn_star300.gif\" alt=\"this is img\"ALIGN=\"right\"/>";
wv.loadData(str, "text/html", "utf-8");