I have a html message like this:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript">
(function(){
document.writeln("<iframe src=\"http://www.example.com" width=\"100%\" height=\"100%\" frameborder=\"0\"></iframe>");
})();
</script>
</head>
<body>
<h1>hello world!</h1>
</body>
</html>
How can i post this as a message in slack ? Does slack accept HTML ?
var message = {
mrkdwn: true,
text: "", //This does not accept my above HTML code
attachments : []
};
slacker.notify(message, function(err, result) {
callback(err, result);
});
Slack allows no HTML element at all. Links, bold, italic, code formatting is only possible by using a Markdown-like syntax. markup is possible without url redirection: slack.com/intl/en-in/help/articles/…
Who can use this feature? Snippets are a quick and easy way to share bits of code, configuration files, or log files in your workspace. Note: You can't currently create or share snippets from the Slack mobile apps.
Slack doesn´t allow HTML elements. But you can format your text with its Markdown flavor, which allows (links, bold, italic etc)
It won't allow javascripts or iframes because of security.
Details : https://api.slack.com/docs/formatting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With