topic Re: Basic HTML and CSS in Alerts in Alert Lab Discussionshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229145#M2889
<HTML><HEAD></HEAD><BODY><P>Use this site to compress the HTML:&nbsp; <A href="http://www.textfixer.com/html/compress-html-compression.php" title="http://www.textfixer.com/html/compress-html-compression.php">Compress HTML</A> </P></BODY></HTML>Thu, 13 Feb 2020 16:37:54 GMTdfairles2020-02-13T16:37:54ZBasic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229141#M2885
<P>I realized that I've never posted this anywhere and I really should have done so.</P>
<P>&nbsp;</P>
<P>I've talked frequently at <A href="https://thwack.solarwinds.com/space/2280" target="_blank">SWUG</A> about using HTML and CSS in alerts because they are pretty.&nbsp; This is my example that I talk about for an alert that triggers for disk volumes which have less than 1 GB free and less than 10% free.&nbsp; I could describe the whole thing, but the important part for this post is the HTML + CSS body of the message and the variables.&nbsp; Without further ado, here it is:</P>
<P>&nbsp;</P>
<PRE class="jive_macro_code _jivemacro_uid_158154961761858 jive_text_macro" data-renderedposition="113_8_1795_1600">&lt;!doctype html&gt;<BR />&lt;html&gt;<BR />&lt;head&gt;<BR />&lt;title&gt;Orion Alert: ${N=Alerting;M=AlertName} for ${N=SwisEntity;M=Caption} on ${N=SwisEntity;M=Node.Caption}&lt;/title&gt;<BR />&lt;style type="text/css"&gt;<BR />.alert_header {<BR />&nbsp;&nbsp;&nbsp; font-family: calibri;<BR />&nbsp;&nbsp;&nbsp; font-size: 16pt;<BR />&nbsp;&nbsp;&nbsp; color: navy;<BR />&nbsp;&nbsp;&nbsp; text-align: left;<BR />&nbsp;&nbsp;&nbsp; font-weight: bold;<BR />&nbsp;&nbsp;&nbsp; vertical-align: center;<BR />}<BR />.alert_description {<BR />&nbsp;&nbsp;&nbsp; font-family: calibri;<BR />&nbsp;&nbsp;&nbsp; font-size: 14pt;<BR />&nbsp;&nbsp;&nbsp; color: gray;<BR />&nbsp;&nbsp;&nbsp; text-align: left;<BR />&nbsp;&nbsp;&nbsp; font-weight: bold;<BR />&nbsp;&nbsp;&nbsp; vertical-align: center;<BR />}<BR />.alert_details {<BR />&nbsp;&nbsp;&nbsp; font-family: calibri;<BR />&nbsp;&nbsp;&nbsp; font-size: 10pt;<BR />&nbsp;&nbsp;&nbsp; color: gray;<BR />&nbsp;&nbsp;&nbsp; text-align: left;<BR />&nbsp;&nbsp;&nbsp; font-weight: bold;<BR />&nbsp;&nbsp;&nbsp; vertical-align: center;<BR />}<BR />th {<BR />&nbsp;&nbsp;&nbsp; font-family: calibri;<BR />&nbsp;&nbsp;&nbsp; font-size: 12pt;<BR />&nbsp;&nbsp;&nbsp; font-weight: bold;<BR />&nbsp;&nbsp;&nbsp; color: white;<BR />&nbsp;&nbsp;&nbsp; background-color: #f99d1c;<BR />&nbsp;&nbsp;&nbsp; text-align: left;<BR />&nbsp;&nbsp;&nbsp; vertical-align: middle;<BR />}<BR />td {<BR />&nbsp;&nbsp;&nbsp; font-family: calibri;<BR />&nbsp;&nbsp;&nbsp; font-size: 12pt;<BR />&nbsp;&nbsp;&nbsp; font-weight: normal;<BR />&nbsp;&nbsp;&nbsp; color: #04c9d7;<BR />&nbsp;&nbsp;&nbsp; background-color: #eeeeee;<BR />&nbsp;&nbsp;&nbsp; text-align: left;<BR />&nbsp;&nbsp;&nbsp; vertical-align: middle;<BR />}<BR />}<BR />&lt;/style&gt;<BR />&lt;/head&gt;<BR />&lt;body&gt;<BR />&lt;table cellspacing="0" cellpadding="1" width="792" border="0"&gt;<BR />&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;table cellspacing="0" cellpadding="0" width="792" border="0"&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td class='alert_header'&gt;${N=SwisEntity;M=Caption} on ${N=SwisEntity;M=Node.Caption} has less than 10% and 1GB free space.&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td class='alert_description'&gt;There is less than 10% and 1GB free on ${N=SwisEntity;M=Caption} on ${N=SwisEntity;M=Node.Caption}.&nbsp; Temp files and extraneous logs have already been removed.&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td class='alert_details'&gt;Alert Name: ${N=Alerting;M=AlertName} / Trigger Time: ${N=Alerting;M=AlertTriggerTime;F=DateTime}&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/table&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;table cellspacing="0" cellpadding="1" width="792" border="1" bordercolor="#003366"&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;table cellspacing="0" cellpadding="3" width="100%" border="0"&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Node&lt;/th&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;img src="http://OrionServer/Orion/images/StatusIcons/${N=SwisEntity;M=Node.StatusLED}" alt="${N=SwisEntity;M=Node.StatusDescription}" width="16" height="16"&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href="http://OrionServer/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:${N=SwisEntity;M=NodeID}"&gt;${N=SwisEntity;M=Node.Caption} / ${N=SwisEntity;M=Node.IP_Address}&lt;/a&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Volume&lt;/th&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;img src="http://OrionServer/NetPerfMon/images/Volumes/${N=SwisEntity;M=Icon}" alt="${N=SwisEntity;M=Caption}" width="16" height="16"&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;a href="http://OrionServer/Orion/NetPerfMon/VolumeDetails?NetObject=V:${N=SwisEntity;M=VolumeID}"&gt;${N=SwisEntity;M=Caption}&lt;/a&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Volume Status&lt;/th&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;img src="http://OrionServer/Orion/images/StatusIcons/${N=SwisEntity;M=StatusIcon}" width="16" height="16" alt="${N=SwisEntity;M=Status}"&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;${N=SwisEntity;M=StatusDescription}&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Free Space&lt;/th&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td&gt;${N=SwisEntity;M=VolumeSpaceAvailable} of ${N=SwisEntity;M=VolumeSize} (${N=SwisEntity;M=VolumePercentAvailable} free)&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/table&gt;&lt;/td&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/table&gt;&lt;/td&gt;<BR />&nbsp; &lt;/tr&gt;<BR />&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp; &lt;td class="alert_details"&gt;Alert Details: ${N=Alerting;M=AlertDescription}&lt;/td&gt;<BR />&nbsp; &lt;/tr&gt;<BR />&nbsp; &lt;tr&gt;<BR />&nbsp;&nbsp;&nbsp; &lt;td class="alert_details"&gt;Acknowledge ${N=Alerting;M=AcknowledgeUrl}&lt;/td&gt;<BR />&nbsp; &lt;/tr&gt;<BR />&lt;/table&gt;<BR />&lt;/body&gt;<BR />&lt;/html&gt;</PRE>
<P>&nbsp;</P>
<P>It's not the easiest thing to read, but the important parts are there.&nbsp; The CSS block at the top (lines 5-49) control the color, the font and the rest of the prettiness.</P>
<P>&nbsp;</P>
<P>This is a rudimentary example, but it makes a pretty alert.&nbsp; In my experience "pretty" alerts get read while plain alerts get filed.</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pastedImage_1.png"><img src="https://thwack.solarwinds.com/t5/image/serverpage/image-id/23251iE6ED173EA06F2AF9/image-size/large?v=1.0&amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /></span></P>
<P>Please note that the above numbers are simulation numbers and wouldn't actually trigger the alert.</P>
<P>&nbsp;</P>
<P>Also, if you are encountering extra lines showing up, then you can flip a switch in the database (required SQL access).</P>
<PRE class="jive_macro_code _jivemacro_uid_15816144509673190 jive_text_macro" data-renderedposition="2124_8_1795_112">/************************************<BR />Fix Alert Email New Line Replacement<BR />*************************************/<BR />UPDATE [dbo].[WebSettings]<BR />SET SettingValue = 'FALSE'<BR />WHERE SettingName = 'Email_ReplaceNewLinesHtml'<BR />&nbsp; AND SettingValue &lt;&gt; 'FALSE'</PRE>
<P>&nbsp;</P>
<P>This is a "fix," but you should totally upvote:&nbsp;<A href="https://thwack.solarwinds.com/t5/NPM-Feature-Requests/EOL-Conversion-in-HTML-Alerts/idi-p/571317" target="_self">EOL Conversion in HTML Alerts</A>&nbsp;</P>
<P>&nbsp;</P>
<P>SQL for EOL Conversions section was added by: Kevin M. Sparenberg</P>Thu, 14 May 2020 17:49:16 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229141#M2885KMSigma2020-05-14T17:49:16ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229142#M2886
<HTML><HEAD></HEAD><BODY><P>Thanks for sharing!&nbsp; I was fortunate enough to attend one of the SWUG's last year and would highly recommend it.&nbsp; It was great to speak to yourself, the other SolarWinds employees, and THWACK MVP's.</P></BODY></HTML>Thu, 13 Feb 2020 16:11:16 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229142#M2886monitoringlife2020-02-13T16:11:16ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229143#M2887
<HTML><HEAD></HEAD><BODY><P>This is fantastic! I recently had to brush the dust off my HTML memories and created "pretty" alerts for our team. I do have a question however... I found a "bug" (for lack of a better word) where you can't maintain the HTML formatting in the "message" field when you are creating the alert, you have to smash all the lines together. This makes it even harder to read and troubleshooting a simple typo is a nightmare. Is there a better method? Or will that be corrected? Currently, I create nicely formatted HTML page in notepadd ++, then merge all the lines together before pasting in to the message field. Otherwise, it takes all the line breaks literally and the alert looks like junk.</P><P></P><P>D</P></BODY></HTML>Thu, 13 Feb 2020 16:24:10 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229143#M2887deverts2020-02-13T16:24:10ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229144#M2888
<HTML><HEAD></HEAD><BODY><P>Still doesn't work without compressing the HTML <IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/sad.png" /> </P></BODY></HTML>Thu, 13 Feb 2020 16:36:41 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229144#M2888dfairles2020-02-13T16:36:41ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229145#M2889
<HTML><HEAD></HEAD><BODY><P>Use this site to compress the HTML:&nbsp; <A href="http://www.textfixer.com/html/compress-html-compression.php" title="http://www.textfixer.com/html/compress-html-compression.php">Compress HTML</A> </P></BODY></HTML>Thu, 13 Feb 2020 16:37:54 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229145#M2889dfairles2020-02-13T16:37:54ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229146#M2890
<HTML><HEAD></HEAD><BODY><P>I wrote a ton of stuff but decided to move it to a feature request (<A __default_attr="11714" __jive_macro_name="idea" class="jive_macro_idea jive_macro" data-orig-content="Trigger Action Adjustable Windows" href="https://thwack.solarwinds.com/"></A> ).&nbsp; I don't want to detract from what KMSigma posted, as its unrelated to his original posts content.</P></BODY></HTML>Thu, 13 Feb 2020 16:40:38 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229146#M2890monitoringlife2020-02-13T16:40:38ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229147#M2891
<HTML><HEAD></HEAD><BODY><P><IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/cry.png" /> Shame we have to do this, but that doesn't take away from the amazing code <A href="https://thwack.solarwinds.com/migrated-users/28882">KMSigma</A>​ shared. I'm definitely going back through my alerts and looking for ways to enhance them using his content. Been a long time since this network engineer had to code HTML! <IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/happy.png" /></P><P></P><P>D</P></BODY></HTML>Thu, 13 Feb 2020 16:48:40 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229147#M2891deverts2020-02-13T16:48:40ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229148#M2892
<HTML><HEAD></HEAD><BODY><P>You don't <EM>technically</EM> have to do it... You I just updated this with a little "hack" to make it behave as you think.</P></BODY></HTML>Thu, 13 Feb 2020 17:22:40 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229148#M2892KMSigma2020-02-13T17:22:40ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229149#M2893
<HTML><HEAD></HEAD><BODY><P>And these "little hacks" are why we gripe and complain in a polite, respectful way. <IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/laugh.png" /> I'm definitely using that hack and your code! This stuff is awesome for a someone like myself.</P><P></P><P>D</P></BODY></HTML>Thu, 13 Feb 2020 18:04:40 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229149#M2893deverts2020-02-13T18:04:40ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229150#M2894
<HTML><HEAD></HEAD><BODY><P>Not sure if you noticed, but the Feature Request I mentioned was my own.&nbsp; I may be an employee of SolarWinds, but I was also a customer.</P></BODY></HTML>Thu, 13 Feb 2020 18:14:07 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229150#M2894KMSigma2020-02-13T18:14:07ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229151#M2895
<HTML><HEAD></HEAD><BODY><P><IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/check.png" /><IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/plus.png" /><IMG src="https://thwack.solarwinds.com/legacyfs/online/emoticons/alert.png" /></P></BODY></HTML>Thu, 13 Feb 2020 18:30:13 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229151#M2895deverts2020-02-13T18:30:13ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229152#M2896
<HTML><HEAD></HEAD><BODY><P>I love this, I am looking to embed a few images in the email to match our internal email format. Right now I have to do it via powershell so that I can add an attachment for the embedded logo, can you think of a way to do that without powershell? <BR />Code I use in PowerShell to attach image:</P><PRE style="background-color: #ffffff;"><SPAN style="color: #8b0000;">$msg</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #00008b;">=</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #0000ff; font-weight: bold;">new-object</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #5a0032;">Net.Mail.MailMessage<BR /></SPAN><SPAN style="color: #8b0000;">$att</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #00008b;">=</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #0000ff; font-weight: bold;">new-object</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #5a0032;">Net.Mail.Attachment</SPAN><SPAN style="color: #000000;">(</SPAN><SPAN style="color: #ff0000;">"C:\Scripts\Email_Resources\logo.jpg"</SPAN><SPAN style="color: #000000;">)<BR /></SPAN><SPAN style="color: #8b0000;">$att</SPAN><SPAN style="color: #000000;">.ContentDisposition.Inline </SPAN><SPAN style="color: #00008b;">=</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #8b0000;">$True<BR /></SPAN><SPAN style="color: #8b0000;">$att</SPAN><SPAN style="color: #000000;">.ContentDisposition.DispositionType </SPAN><SPAN style="color: #00008b;">=</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #ff0000;">"Inline"<BR /></SPAN><SPAN style="color: #8b0000;">$att</SPAN><SPAN style="color: #000000;">.ContentType.MediaType </SPAN><SPAN style="color: #00008b;">=</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #ff0000;">"image/jpg"<BR /></SPAN><SPAN style="color: #8b0000;">$att</SPAN><SPAN style="color: #000000;">.ContentId </SPAN><SPAN style="color: #00008b;">=</SPAN><SPAN style="color: #000000;"> </SPAN><SPAN style="color: #ff0000;">"logo"</SPAN></PRE><P>And then in the body html I call the image: </P><P>&lt;img src='cid:logo'&gt;</P></BODY></HTML>Fri, 14 Feb 2020 14:32:15 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229152#M2896jm_sysadmin2020-02-14T14:32:15ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229153#M2897
<HTML><HEAD></HEAD><BODY><P>There's not maybe a public or internal url holding those images that your users would reliably be able to load is there?&nbsp; Instead of adding the image to the payload of the email just put in an &lt;img&gt; that points to the company website or something?</P></BODY></HTML>Fri, 14 Feb 2020 16:11:37 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229153#M2897mesverrum2020-02-14T16:11:37ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229154#M2898
<HTML><HEAD></HEAD><BODY><P>I should be able to dig one up, its a much simpler solution. Maybe even drop the one onto Orion and pull it from there.</P><P>Edit: I should say that I don't pick the format/image, we have a specific approved formatting for message I am matching so users know the content came from IT. Otherwise just any logo image from the site would do.</P></BODY></HTML>Fri, 14 Feb 2020 17:01:54 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/229154#M2898jm_sysadmin2020-02-14T17:01:54ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/590603#M6369
<P>Very nice! I came back to NPM after doing some work with in 5 years ago and see somethings have improved in the platform. As my alerts are all received internally I link to external stylesheets which gives me really good flexibility.&nbsp;</P>Fri, 01 May 2020 15:39:29 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/590603#M6369shocko2020-05-01T15:39:29ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/590604#M6370
<P>This will scale horribly! I host them on a website that's available internally and externally or embedded them with base64 but the latter bloats the mail size and some security products don't like it.&nbsp;</P>Fri, 01 May 2020 15:46:09 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/590604#M6370shocko2020-05-01T15:46:09ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/590613#M6371
<P>Should the query to update not be as follows?</P><P>&nbsp;</P><DIV><DIV><SPAN>UPDATE</SPAN><SPAN>&nbsp;[dbo].[WebSettings]</SPAN></DIV><DIV><SPAN>SET</SPAN><SPAN>&nbsp;SettingValue&nbsp;=&nbsp;</SPAN><SPAN>'FALSE'</SPAN></DIV><DIV><SPAN>WHERE</SPAN><SPAN>&nbsp;SettingName&nbsp;=&nbsp;</SPAN><SPAN>'Email_ReplaceNewLinesHtml'</SPAN></DIV><DIV><SPAN>AND</SPAN><SPAN>&nbsp;SettingValue&nbsp;&lt;&gt;&nbsp;</SPAN><SPAN>'<FONT color="#FF6600"><STRONG>FALSE</STRONG></FONT>'</SPAN></DIV></DIV>Fri, 01 May 2020 16:25:27 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/590613#M6371shocko2020-05-01T16:25:27ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/593035#M6378
<P>Not if you run the SQL query at the end of the original post.</P>Fri, 22 May 2020 05:52:21 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/593035#M6378ioan_bucsa2020-05-22T05:52:21ZRe: Basic HTML and CSS in Alertshttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/593038#M6379
<P><LI-USER uid="6"></LI-USER>&nbsp;I was on the Virtual SWUG the other day and I thought this was very cool. I started working on it right after the session was over and then bumped onto your post when trying to figure out why my css was not being interpreted properly <span class="lia-unicode-emoji" title=":slightly_smiling_face:">🙂</span>&nbsp;</P><P>Long story short:&nbsp;</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ioan_bucsa_0-1590127607135.png" style="width: 841px;"><img src="https://xcdhs76427.i.lithium.com/t5/image/serverpage/image-id/64868iD6E3CBDA651BA8FD/image-dimensions/841x145?v=1.0" width="841" height="145" title="ioan_bucsa_0-1590127607135.png" alt="ioan_bucsa_0-1590127607135.png" /></span></P><P>&nbsp;</P>Fri, 22 May 2020 06:08:14 GMThttps://thwack.solarwinds.com/t5/Alert-Lab-Discussions/Basic-HTML-and-CSS-in-Alerts/m-p/593038#M6379ioan_bucsa2020-05-22T06:08:14Z