<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use HTML code in email alerts to format the message body? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278061#M5124</link>
    <description>&lt;P&gt;Hi @ibondarets,&lt;/P&gt;

&lt;P&gt;I was having a similar use case, to add HTML tags to Alert Mail.&lt;BR /&gt;
I tried everything in the alerts_action.conf but was not able to achieve the results. Then I tried your suggestion of modifying the sendemail.py. It works like a charm. Thanks a Lot.&lt;/P&gt;

&lt;P&gt;I may be an amateur, and therefore cannot deduce the logic behind this. It would be of great help if you can provide a brief explanation of the changes made in the python file. Does it have any negative affectc or can hamper any other functionality? Did you came out with an alternative to this solution?&lt;/P&gt;

&lt;P&gt;I know this is an old post, and I have posed a lot of questions. But Thanks in Advance. I'll be waiting for your response patiently.&lt;/P&gt;

&lt;P&gt;Thanks Again. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2017 08:15:11 GMT</pubDate>
    <dc:creator>Honey0308</dc:creator>
    <dc:date>2017-07-10T08:15:11Z</dc:date>
    <item>
      <title>How to use HTML code in email alerts to format the message body?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278058#M5121</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I'm trying to create an email alert and format the message body in a particular way, because inline table/raw/csv doesn't suit my needs.&lt;BR /&gt;
I'm selecting "HTML &amp;amp; Plain text" as action type and try to use HTML tags, but they're all ignored and treated by Splunk as text.&lt;/P&gt;

&lt;P&gt;How can I do that?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 14:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278058#M5121</guid>
      <dc:creator>ibondarets</dc:creator>
      <dc:date>2016-04-07T14:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use HTML code in email alerts to format the message body?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278059#M5122</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Set the properties in alert_actions.conf file &lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 15:24:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278059#M5122</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-04-07T15:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use HTML code in email alerts to format the message body?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278060#M5123</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;
Thank you for reply.&lt;BR /&gt;
What properties?&lt;/P&gt;

&lt;P&gt;I tried to add: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;content_type = html
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to /opt/splunk/etc/system/local/alert_actions.conf&lt;/P&gt;

&lt;P&gt;No result.&lt;/P&gt;

&lt;P&gt;The only thing that helps is to change {msg|h} to {msg} in &lt;BR /&gt;
/opt/splunk/etc/apps/search/bin/sendemail.py&lt;BR /&gt;
but it's a dirty hack that wil break after every splunk update.&lt;/P&gt;

&lt;P&gt;I need a supported way to do it...&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 15:54:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278060#M5123</guid>
      <dc:creator>ibondarets</dc:creator>
      <dc:date>2016-04-07T15:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use HTML code in email alerts to format the message body?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278061#M5124</link>
      <description>&lt;P&gt;Hi @ibondarets,&lt;/P&gt;

&lt;P&gt;I was having a similar use case, to add HTML tags to Alert Mail.&lt;BR /&gt;
I tried everything in the alerts_action.conf but was not able to achieve the results. Then I tried your suggestion of modifying the sendemail.py. It works like a charm. Thanks a Lot.&lt;/P&gt;

&lt;P&gt;I may be an amateur, and therefore cannot deduce the logic behind this. It would be of great help if you can provide a brief explanation of the changes made in the python file. Does it have any negative affectc or can hamper any other functionality? Did you came out with an alternative to this solution?&lt;/P&gt;

&lt;P&gt;I know this is an old post, and I have posed a lot of questions. But Thanks in Advance. I'll be waiting for your response patiently.&lt;/P&gt;

&lt;P&gt;Thanks Again. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 08:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278061#M5124</guid>
      <dc:creator>Honey0308</dc:creator>
      <dc:date>2017-07-10T08:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use HTML code in email alerts to format the message body?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278062#M5125</link>
      <description>&lt;P&gt;I downvoted this post because alert_action.conf is a conf for all alerts (not just for one alert). in addition, the file is in root access on a unix server and in an enterprise solution, we can not modify it.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 09:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278062#M5125</guid>
      <dc:creator>mclane1</dc:creator>
      <dc:date>2019-01-04T09:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use HTML code in email alerts to format the message body?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278063#M5126</link>
      <description>&lt;P&gt;Action "Send email" does not allow to use your own HTML in the message. If this action's options are too limiting, you need to go for Custom alert actions, see &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.1/AdvancedDev/ModAlertsIntro"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.1/AdvancedDev/ModAlertsIntro&lt;/A&gt; .&lt;/P&gt;

&lt;P&gt;For sake of completeness, "Run script" action could also help (ie. you could copy default sendmail.py and alter it to your needs, or write your own script from scratch), however this method has been deprecated in favor of Custom alert actions.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 09:31:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-use-HTML-code-in-email-alerts-to-format-the-message-body/m-p/278063#M5126</guid>
      <dc:creator>eregon</dc:creator>
      <dc:date>2019-04-01T09:31:04Z</dc:date>
    </item>
  </channel>
</rss>

