Formatting output from Invoke-WebRequest in Powershell - powershell

Information
So what I am looking to do is scrape my local intranet where our HR team upload new starter information and be able to either hold that information in a usable format, or export it to a CSV to then be used by another script.
Currently our service desk team manually go looking at this intranet page, and create the users based on the information our HR team enter one by one.
Naturally, this is a very time consuming task that could be easily automated. Unfortunately, our HR team are not open for any changes to the process at the current time due to other work they are focusing on. Internal politics stuff, so sadly they can't be convinced.
Now, I have managed to use Invoke-WebRequest and get the content of the page but the formatting is awful. It returns as a load of HTML and I'm iterating through multiple steps of splitting and string replacing which just doesn't feel optimal to me and I feel like there is a better way to get the results I want.
Current Script
$webRequest = Invoke-WebRequest -Uri "http://intranet-site/HR/NewStarterList.php?action=ItToComp" -Headers #{"Header Info here"} -UseDefaultCredentials
$content = $webRequest.Content
$initialReplace = $content -replace '(?<=<).*?(?=>)', ' '
$split = $initialReplace -split "< >< >< >"
$split = $split -split "< >< >"
$split = $split -replace '< >',""
$split = $split[5..$($split.count)]
As you can see, this is not really ideal, and I'm wondering if there is a better way to grab just the information I need from the page.
The initial content returns as below (I have shortened and replaced any names to make it easy on the eye)
<html>
<head>
<title>New Starter List</title>
<link rel="STYLESHEET" type="text/css" href="/common/StyleSheet/Reports.css" /> <style> TD {font-family: Verdana; font-size: 8pt; border-left: solid 0px black; border-right: solid 0px black;} </style>
<script type="text/javascript" src="../../../cgi-bin/calendar/tableH.js"></script>
</head>
<body>
<img src="/common/images/logo.gif" border="0">
<br>
<br>
<b><span style="font-size: 12pt; font-variant: small-caps; ">New Starter List</span></b>
<br>Logged In As "UserName"<br>
<br>
<tableonMouseOver="javascript:trackTableHighlight(this.event,'FFFF66');"onMouseOut="javascript:highlightTableRow(0);" border="4" frame="border" width="80%" rules="none" cellspacing="6%" cellpadding="6%">
<th align="left">Date Started</th>
<th align="left">Name</th>
<th align="left">Initials</th>
<th align="left">Department</th>
<th align="left">Contact</th>
<th align="left">IT Completed?</th>
<th align="left">Supervisor Completed?</th>
<tr colspan="6"><td align="left">25 Sep 2019</td>
<td align="left">Joe Bloggs</td>
<td align="left">JXBL</td>
<td align="left">Team A</td>
<td align="left">Manager 1</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<tr colspan="6"><td align="left">08 Jul 2019</td>
<td align="left">Harry Bloggs</td>
<td align="left">HXBL</td>
<td align="left">Team B</td>
<td align="left">Manager 2</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<th align="left" colspan="7">72 starters</th>
</table>
</body>
</html>
After I run my splits and replaces, It looks like below (again, names changed)
25 Sep 2019
Joe Bloggs
JXBL
Team 1
Manager 1
No
Yes
08 Jul 2019
Harry Bloggs
HXBL
Team 2
Manager 2
No
Yes
72 starters
The idea is then to be able to run with this information to automate our on-boarding process.
I feel like I am missing something obvious, like there is a neater or more efficient way to do this, as this is the first time I'm using Invoke-WebRequest and finding it troublesome as it is anyway.
Expected Results
What I want is preferably an array of users with properties for each bit of info, like a CSV or a PSObject.
So when I call a variable holding the info, I want it to return something like the below:
Name : Joe Bloggs
Initials : JXBL
Department : Team 1
Manager : Manager 1
IT : No
Supervisor : No
StartDate : 08 Jul 2019
Name : Harry Smith
Initials : HXSM
Department : Team 2
Manager : Manager 2
IT : Yes
Supervisor : No
Similar Questions
I only saw one question that looked like it may cover what I wanted, but it ended up being about needing a "try-catch" loop.
Similar Question Link
Please let me know if you need any further information, or if you have any questions.
Thanks in advance for the help.
EDIT
Added in an expected results bit, as I realized this was missing.

The trick is to have something to denote the lines you want to keep.
In your sample above, the link stands out:
<a href="NewStarterInfo.php?id=3117">
So, if you import the page as a single array, you can parse that array finding only lines that contain "NewStarterInfo.php" for example.
$a = #"
<html>
<head>
<title>New Starter List</title>
<link rel="STYLESHEET" type="text/css" href="/common/StyleSheet/Reports.css" /> <style> TD {font-family: Verdana; font-size: 8pt; border-left: solid 0px black; border-right: solid 0px black;} </style>
<script type="text/javascript" src="../../../cgi-bin/calendar/tableH.js"></script>
</head>
<body>
<img src="/common/images/logo.gif" border="0">
<br>
<br>
<b><span style="font-size: 12pt; font-variant: small-caps; ">New Starter List</span></b>
<br>Logged In As "UserName"<br>
<br>
<tableonMouseOver="javascript:trackTableHighlight(this.event,'FFFF66');"onMouseOut="javascript:highlightTableRow(0);" border="4" frame="border" width="80%" rules="none" cellspacing="6%" cellpadding="6%">
<th align="left">Date Started</th>
<th align="left">Name</th>
<th align="left">Initials</th>
<th align="left">Department</th>
<th align="left">Contact</th>
<th align="left">IT Completed?</th>
<th align="left">Supervisor Completed?</th>
<tr colspan="6"><td align="left">25 Sep 2019</td>
<td align="left">Joe Bloggs</td>
<td align="left">JXBL</td>
<td align="left">Team A</td>
<td align="left">Manager 1</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<tr colspan="6"><td align="left">08 Jul 2019</td>
<td align="left">Harry Bloggs</td>
<td align="left">HXBL</td>
<td align="left">Team B</td>
<td align="left">Manager 2</td>
<td align="left">No</td>
<td align="left">Yes</td></tr>
<th align="left" colspan="7">72 starters</th>
</table>
</body>
</html>
"#
With $a set to the content of the page, loop thru it.
foreach($x in $a.split("<")) # break it at the "<" that starts each line.
{
if ($x.contains("NewStarterInfo.php") -eq $true) { write-host $x.split(">")[1] }
}
This will take all of the lines in a single variable (not an array) and find the lines with a person's name, and display the name.
If you actually have an array, then you can omit the .split("<") from the foreach statement.

Related

Powershell email sender with html body (htmlbody.Replace)

I'm currently a C# dotnet automation engineer. One of my tests results output is via email. My tests results output goes through powershell. I'm fairly new to email templates and HTML in general.
It's a simple HTML body with variables that I replace with $EmailBody= $EmailBody.Replace("PassedTests",$Passed) function etc
The whole premise: my script replaces Total tests/Passed/Failed/Skipped with data that I extract from a .trx file after the test run.
My extraction code:
$PassedTests = $testResultsXml.TestRun.ResultSummary.Counters.Passed
$FailedTests = $testResultsXml.TestRun.ResultSummary.Counters.Failed
$SkippedTests = $testResultsXml.TestRun.ResultSummary.Counters.Skipped
$OnlyFailed = $testResultsXml.TestRun.Results.UnitTestResult | Where-Object { $_.outcome -eq "Failed" }
$FailedTestsName = $OnlyFailed.TestName
I have the "Error list" table (picture below) that shows test names if there are any failed tests that in the HTML body
#</td>
</tr>
<!--end img-->
<tr>
<td height="15"></td>
</tr>
<!--title-->
<tr align="center">
<td align="center" style="font-family:
'Open Sans', Arial, sans-serif; font-size:16px;color:#3b3b3b;font-weight: bold;">**ERROR LIST**</td>
</tr>
<!--end title-->
<tr>
<td height="10"></td>
</tr>
<!--content-->
<tr align="center">
<td align="center" style="font-family: 'Open Sans', Arial, sans-serif; font-size:12px;color:#7f8c8d;line-height: 24px;">NoErrors</td>
</tr>
<!--end content-->
</table>
</td>
</tr>
<tr>
<td height="30"></td>
</tr>
</table>
Now the main question is: is it somehow possible to ONLY show the "Error list" table only IF there are any failed tests? If there are no failed tests it would be great for that table not to be shown at all.
Any kind of help would be greatly appreciated. Thanks!
$EmailBody= $EmailBody.Replace("PassedTests",$Passed)
$EmailBody= $EmailBody.Replace("FailedTests",$Failed)
$EmailBody= $EmailBody.Replace("SkippedTests",$Skipped)
$EmailBody= $EmailBody.Replace("ErrorList",$FailedTestsName)
$Emailattachment = "\TestResults.trx"
You are on the good path.
You just need to extend what you are doing.
Remove the thing that might or might not be in the email (The "errors list" section as it won't be there if there are no error)
Put the section your removed in its own variable
Add a placeholder in your main html template at the location where it is supposed to be (just like you do already so we can do a replace in the html template.
From there, the logic is :
If there are 0 errors, you replace the placeholder from the main template by an empty string (you don't want that placeholder to appear in the final email)
If there are 1 or more error, instead of replacing by your error list, you build a new variable that contain the section you want to append, then you replace its loop by the errors content and finally you replace the placeholder by that section (which contains the error loop)
That would look something like this.
$EmailBody = #'
</td>
</tr>
<!--end img-->
<tr>
<td height="15"></td>
</tr>
**ErrorsTable**
'#
$ErrorListBody = #'
<!--title-->
<tr align="center">
<td align="center" style="font-family:
'Open Sans', Arial, sans-serif; font-size:16px;color:#3b3b3b;font-weight: bold;">**ERROR LIST**</td>
</tr>
<!--end title-->
<tr>
<td height="10"></td>
</tr>
<!--content-->
<tr align="center">
<td align="center" style="font-family: 'Open Sans', Arial, sans-serif; font-size:12px;color:#7f8c8d;line-height: 24px;">NoErrors</td>
</tr>
<!--end content-->
</table>
</td>
</tr>
<tr>
<td height="30"></td>
</tr>
</table>
'#
if ($FailedTests.Count -gt 0) {
# inserting errors to the `$ErrorListBody` html segment
$ErrorsHtml = $ErrorListBody.Replace("ErrorList", $FailedTestsName)
# inserting the html segment into the main email
$EmailBody = $EmailBody.Replace("**ErrorsTable**", $ErrorsHtml)
} else {
# Removing the placeholder from the main template.
$EmailBody = $EmailBody.Replace("**ErrorsTable**", '')
}

How can I add a dotted line between two texts with HTML2PDF

I'm trying to create a pricing recap at the end of a document I'm working on. I would like it to have a dotted line between the item on the left and the price on its right, very much like this :
However, this Index is generated with the createIndex function and I don't have the source HTML for this. And I've been trying since yesterday with differente HTML syntaxes to make it work but it is impossible. My best attempt so far is this one, but I can't automatically set the width of the dotted line :
<table style="width:100%;border-collapse: collapse;">
<tr>
<td style="width:40%;white-space:nowrap;">Item 1</td>
<td style="border-bottom:dotted 1px black;width:45%;"></td>
<td style="text-align:right;width:15%;white-space:nowrap;">Price 1€ HT</td>
</tr>
</table>
I really am stuck here, any advice would be welcome.
In this case you can use a little 'hack'. Unset the width of both texts (resolves to width: auto;) and set the width of the dotted line container to width: 99%;. For this to work you also need to set white-space: nowrap on the text elements, but you already did that.
<table style="width:100%;border-collapse: collapse;">
<tr>
<td style="white-space:nowrap;">Item 1</td>
<td style="border-bottom:dotted 1px black;width:99%"></td>
<td style="text-align:right;white-space:nowrap;">Price 1€ HT</td>
</tr>
</table>

Removing a line from HTML Pogramatically through Open2

I have a code that shows up in two different places, one is a browser html page, then the other is a downloaded PDF. On this page there is a line that says "print using the print button" but of course that isn't on the PDF model so I would like to remove it when the function printFilePdf is run. However I can't add (or I don't know how) a condition do the HTML that is in the method.
sub printHeader {
my ($outFH) = #_;
my ($sec, $min, $hour, $mday, $month, $year) = (localtime)[0, 1, 2, 3, 4, 5];
$month++;
$year += 1900;
my ($string) = scalar localtime(time());
print $outFH <<EOT;
<html>
<head>
<title>THIS IS A TITLE</title>
</head>
<body>
<table width="640" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bold"> </td>
</tr>
<tr>
<td class="bold">
<div align="center" class="header">
I want to keep this line $string<br>
</div>
</td>
</tr>
<tr>
<td class="bold"> </td>
</tr>
<tr>
<td class="bold" style="color: red; text-align: center">
I also what to keep this line.
</td>
</tr>
<tr>
<td class="bold" style="color: red; text-align: center">
This line is not needed when the printFilePdf function is run.
</td>
</tr>
</table>
EOT
print $outFH qq(<p align="center"> </p>);
print $outFH <<EOT;
</td>
</tr>
</table>
EOT
}
Is there anyway to do this? Like add a name to the table row and in the method above say something like
if(!printFilePdf())
{
<tr>
<td class="bold" style="color: red; text-align: center">
This line is not needed when the printFilePdf function is run.
</td>
</tr>
}
You could check the caller. If caller is printFilePdf then search and replace to delete unneeded data.
perldoc -f caller
As a side note: If you are using some templating engine like HTML::Template then it'd be lot easier. In that case you can put conditionals in HTML.
<TMPL_IF NAME="NON_PDF">
Some text that only gets displayed if NON_PDF is true!
</TMPL_IF>
Just break the HTML into two parts: one is common to both the formats, one is HTML specific:
#!/usr/bin/perl
use warnings;
use strict;
sub printHeader {
my ($outFH, $goes_to_html) = #_;
print $outFH <<'__HTML__';
Here is the common text.
__HTML__
print $outFH <<'__HTML__' if $goes_to_html;
This doesn't go to PDF.
__HTML__
}
print "To HTML:\n";
printHeader(*STDOUT, 1);
print "To PDF:\n";
printHeader(*STDOUT, 0);

Issue with image in table using GMail online client

I am creating an email template to use in Pardot. I have coded the email up. It works fine in OSX Mail, Outlook 07 +, Opera Mail, however GMail is being a real pain. It is adding some weird height or something to the tr or td in my table.
Any suggestions?
<table border="0" cellpadding="0" cellspacing="0" width="228">
<tbody>
<tr valign="bottom">
<td valign="bottom"><span pardot-region=""><img src="widget_top.jpg" alt="Placeholder"></span></td>
</tr>
<tr bgcolor="#ffd13f">
<td style="padding: 10px;">
<h2><span pardot-region="">Subheading span across one or two lines for best practice:</span></h2>
<span pardot-region=""><p><b>Date:</b> Thursday 29 November</p>
<p><b>Time:</b> 1.30pm (GMT)</p>
<p><b>Where:</b> Register online ></p>
<p><b>Topic:</b> Dynamic performance management</p>
<p><b>Presenters:</b> Octavius Black, CEO and Sebastian Bailey, President</p></span>
</td>
</tr>
<tr valign="top">
<td valign="top"><span pardot-region=""><img src="widget_bottom.jpg" alt="Placeholder"></span></td>
</tr>
</tbody>
</table>
(this table is inside a set of tested tables).
Screen shot can be found here: http://i45.tinypic.com/15wzda9.png
Cheers :)
On the images you have to put (inline)
style="display:block;"
:)
display:block; is definitely needed. You probably should zero out everything in all img tags, and set width and heights also.
<img style="margin: 0; border: 0; padding: 0; display: block;" src="" width="600" height="150"
alt="">
Also, you don't need the spans inside the table cells. If you want to keep them, make sure they have margin and padding zero'd out there too.

In Email, Image (img) Source (src) Tags are rewritten as relative links. How to fix?

I'm working on sending out an html based email, and every time it sends the image src tags and some of the anchor href tags are modified to be relative url's.
Update 2: This is happening between when the body of the email is generated and sent and when it arrives in my inbox.
Update: I am using Postfix on a LAMPP server. In addition, I am using Zend_Mail to send the emails out.
For example, I have a link:
src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/header.jpg"
And it gets rewritten as:
src="../../../../images/email/highpoint_2009_04/header.jpg"
What can cause this to occur and how is it corrected?
Email headers:
Return-Path: <root#example.com>
X-Original-To: gabe#example.com
Delivered-To: gabe#example.com
Received: by mail.example.com (Postfix, from userid 0)
id 6BF012252; Tue, 14 Apr 2009 12:15:20 -0600 (MDT)
To: Gabriel <gabe#example.com>
Subject: Free Map to Sales Success
From: Somebody <info#example.com>
Date: Tue, 14 Apr 2009 12:15:20 -0600
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: multipart/related
Content-Disposition: inline
Message-Id: <20090414181520.6BF012252#mail.example.com>
Original content to be sent out:
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody>
<tr>
<td valign="top">
<a href="http://www.furnituretrainingcompany.com">
<img moz-do-not-send="true" alt="The Furniture Training Company - Know More. Sell More." src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/header.jpg" border="0" height="123" width="600">
</a>
</td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0"
width="600">
<tbody>
<tr>
<td valign="top"><img alt="Visit us at High Point to receive your free training poster" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/hero.jpg" moz-do-not-send="true" height="150" width="600"><br>
</td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0"
width="600">
<tbody>
<tr>
<td bgcolor="#ffffff" valign="top"><img alt="" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer_content_left.jpg" moz-do-not-send="true" height="30" width="30"><br>
</td>
<td bgcolor="#ffffff" valign="top"><font originaltag="yes" style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;" color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><big><small><big><b>See you at Market</b></big><br>
</small></big></big></big></big></font>
<font originaltag="yes" style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;" color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><big><small><br>
</small></big></big></big></big></font><small><font
face="Helvetica, Arial, sans-serif">Visit our space to get your free
Map to Sales Success poster! This unique 24 X 36 color poster is your
guide to developing high volume salespeople with larger tickets. Find
us in the new NHFA Retailer Resource Center located in the Plaza. <br>
<br>
Don’t miss Mark Lacy’s entertaining seminar "Help Wanted! My Sales
Associates Can’t Sell Water to a Thirsty Camel." He’ll reveal powerful
secrets for turning sales associates into furniture experts that will
sell. See him Saturday, April 25th at 11:30 AM in the seminar room of
the
new NHFA Retail Resource Center in the Plaza. <br>
<br>
Stop by our space to learn how our ingenious internet-delivered
training courses are easy to use, guaranteed to work, and cheaper than
the daily donuts. Over 95% report increased sales. <br>
<br>
Plan to see us at High Point. </font></small>
<font originaltag="yes" style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;" color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><big><small><small><br>
<br>
<br>
<br>
</small></small></big></big></big></big></font><small><font
originaltag="yes"
style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;"
color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><small>
</small></big></big></big></font></small>
<img alt="Find out more" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/image_content_left.jpg" moz-do-not-send="true" border="0" height="67" width="326"><br>
<br>
</td>
<td bgcolor="#ffffff" valign="top">
<img alt="" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer_content_middle.jpg" moz-do-not-send="true" height="28" width="28"><br>
</td>
<td bgcolor="#ffffff" valign="top"><img alt="Roadmap to Sales Success poster" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/image_content_right.jpg" moz-do-not-send="true" height="267" width="186"><br>
<font face="Helvetica, Arial, sans-serif"><small><font originaltag="yes" style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;" color="#000000" size="1"><big><big><big><small><b>Road
Map to Sales Success<br>
</b><br>
</small></big></big></big></font>This beautiful poster is yours
free for simply stopping by and visiting with us at High Point. <span
class="moz-txt-slash">Our space is located inside the </span>new NHFA
Retailer Resource Center in the Plaza Suites, 222 South Main St, 1st
Floor. We will be at market from Sat April 25th until Thur
April 30th. </small></font><br>
</td>
<td bgcolor="#ffffff" valign="top"><img alt="" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer_content_right.jpg"
moz-do-not-send="true" height="30" width="30"><br>
<br>
</td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0"
width="600">
<tbody>
<tr>
<td bgcolor="#ffffff" valign="top"><img alt="" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/disclaimer_divider.jpg"
moz-do-not-send="true" height="25" width="600"><br>
</td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0"
width="600">
<tbody>
<tr>
<td bgcolor="#ffffff" valign="top"><img alt="" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer_disclaimer_left.jpg"
moz-do-not-send="true"></td>
<td bgcolor="#ffffff" valign="top"><img alt="" src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer_disclaimer_middle.jpg"
moz-do-not-send="true"><br>
<font originaltag="yes"
style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;"
color="#666666" face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><big><small><small><small>If
you are not attending the High Point market in April but
would still like to receive a free Road Map to Sales Success poster
visit us on the web at <u><a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="http://www.furnituretrainingcompany.com">www.furnituretrainingcompany.com</a></u>,
or to
speak with a Furniture Training Company representative, call toll free
(866) 755-5996. We do not offer free shipping outside of the U.S. and
Canada. Retailers outside of the U.S. and Canada may call for more
information. Limit one free Road Map to Sales Success per company.
Other copies of the poster may be purchased on our web site.<br>
<br>
</small></small></small></big></big></big></big></font> <font
color="#666666"><small><font originaltag="yes"
style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;"
face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><small><small>We
hope you found this message to be useful. However, if you'd
rather not receive future emails of this sort from The Furniture
Training Company, please <a moz-do-not-send="true"
href="http://www.furnituretraining.com/contact">click here to
unsubscribe</a>.<br>
<br>
</small></small></big></big></big></font></small><small><font
originaltag="yes"
style="font-size: 9px; font-family: Verdana,Arial,Helvetica,sans-serif;"
face="Verdana, Arial, Helvetica, sans-serif" size="1"><big><big><big><small><small>©Copyright
2009 The Furniture Training Company.<br>
1770 North Research Park
Way, <br>
North Logan, UT 84341. <br>
All Rights Reserved.</small></small></big></big></big></font></small></font><br>
</td>
<td bgcolor="#ffffff" valign="top"><img alt=""
src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer_disclaimer_right.jpg"
moz-do-not-send="true"></td>
</tr>
</tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0"
width="600">
<tbody>
<tr>
<td bgcolor="#ffffff" valign="top"><img alt=""
src="http://www.furnituretrainingcompany.com/images/email/highpoint_2009_04/footer.jpg"
moz-do-not-send="true"> </td>
</tr>
</tbody>
</table>
<br>
<br>
Content that gets sent:
<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"600" al=
ign=3D"center">=0D=0A<tbody>=0D=0A<tr>=0D=0A<td valign=3D"top"><a href=
=3D"http://www.furnituretrainingcompany.com"> <img src=3D"http://www.fur=
nituretrainingcompany.com/images/email/highpoint_2009_04/header.jpg" bor=
der=3D"0" alt=3D"The Furniture Training Company - Know More. Sell More."=
width=3D"600" height=3D"123" /> </a></td>=0D=0A</tr>=0D=0A</tbody>=0D=
=0A</table>=0D=0A<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0"=
width=3D"600" align=3D"center">=0D=0A<tbody>=0D=0A<tr>=0D=0A<td valign=
=3D"top"><img src=3D"http://www.furnituretrainingcompany.com/images/emai=
l/highpoint_2009_04/hero.jpg" alt=3D"Visit us at High Point to receive y=
our free training poster" width=3D"600" height=3D"150" /><br /></td>=0D=
=0A</tr>=0D=0A</tbody>=0D=0A</table>=0D=0A<table border=3D"0" cellspacin=
g=3D"0" cellpadding=3D"0" width=3D"600" align=3D"center">=0D=0A<tbody>=
=0D=0A<tr>=0D=0A<td valign=3D"top" bgcolor=3D"#ffffff"><img src=3D"http:=
//www.furnituretrainingcompany.com/images/email/highpoint_2009_04/spacer=
_content_left.jpg" alt=3D"" width=3D"30" height=3D"30" /><br /></td>=0D=
=0A<td valign=3D"top" bgcolor=3D"#ffffff"><span style=3D"font-size: xx-s=
mall; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000;">=
<big><big><big><big><small><big><strong>See you at Market</strong></big>=
<br /> </small></big></big></big></big></span> <span style=3D"font-size:=
xx-small; font-family: Verdana,Arial,Helvetica,sans-serif; color: #0000=
00;"><big><big><big><big><small><br /> </small></big></big></big></big><=
/span><small><span style=3D"font-family: Helvetica,Arial,sans-serif;">Vi=
sit our space to get your free Map to Sales Success poster! This unique=
24 X 36 color poster is your guide to developing high volume salespeopl=
e with larger tickets. Find us in the new NHFA Retailer Resource Center=
located in the Plaza. <br /> <br /> Don’t miss Mark Lacy’s=
entertaining seminar "Help Wanted! My Sales Associates Can’t Sell=
Water to a Thirsty Camel." He’ll reveal powerful secrets for turn=
ing sales associates into furniture experts that will sell. See him Satu=
rday, April 25th at 11:30 AM in the seminar room of the new NHFA Retail=
Resource Center in the Plaza. <br /> <br /> Stop by our space to learn=
how our ingenious internet-delivered training courses are easy to use,=
guaranteed to work, and cheaper than the daily donuts. Over 95% report=
increased sales. <br /> <br /> Plan to see us at High Point. </span></s=
mall> <span style=3D"font-size: xx-small; font-family: Verdana,Arial,Hel=
vetica,sans-serif; color: #000000;"><big><big><big><big><small><small><b=
r /> <br /> <br /> <br /> </small></small></big></big></big></big></span=
><small><span style=3D"font-size: xx-small; font-family: Verdana,Arial,H=
elvetica,sans-serif; color: #000000;"><big><big><big><small> </small></b=
ig></big></big></span></small> <a href=3D"http://www.furnituretrainingco=
mpany.com/map"><img src=3D"http://www.furnituretrainingcompany.com/image=
s/email/highpoint_2009_04/image_content_left.jpg" border=3D"0" alt=3D"Fi=
nd out more" width=3D"326" height=3D"67" /></a><br /> <br /></td>=0D=0A<=
td valign=3D"top" bgcolor=3D"#ffffff"><img src=3D"http://www.furnituretr=
ainingcompany.com/images/email/highpoint_2009_04/spacer_content_middle.j=
pg" alt=3D"" width=3D"28" height=3D"28" /><br /></td>=0D=0A<td valign=3D=
"top" bgcolor=3D"#ffffff"><img src=3D"http://www.furnituretrainingcompan=
y.com/images/email/highpoint_2009_04/image_content_right.jpg" alt=3D"Roa=
dmap to Sales Success poster" width=3D"186" height=3D"267" /><br /> <spa=
n style=3D"font-family: Helvetica,Arial,sans-serif;"><small><span style=
=3D"font-size: xx-small; color: #000000;"><big><big><big><small><strong>=
Road Map to Sales Success<br /> </strong><br /> </small></big></big></bi=
g></span>This beautiful poster is yours free for simply stopping by and=
visiting with us at High Point. <span class=3D"moz-txt-slash">Our space=
is located inside the </span>new NHFA Retailer Resource Center in the P=
laza Suites, 222 South Main St, 1st Floor. We will be at market from Sat=
April 25th until Thur April 30th. </small></span><br /></td>=0D=0A<td v=
align=3D"top" bgcolor=3D"#ffffff"><img src=3D"http://www.furnituretraini=
ngcompany.com/images/email/highpoint_2009_04/spacer_content_right.jpg" a=
lt=3D"" width=3D"30" height=3D"30" /><br /> <br /></td>=0D=0A</tr>=0D=0A=
</tbody>=0D=0A</table>=0D=0A<table border=3D"0" cellspacing=3D"0" cellpa=
dding=3D"0" width=3D"600" align=3D"center">=0D=0A<tbody>=0D=0A<tr>=0D=0A=
<td valign=3D"top" bgcolor=3D"#ffffff"><img src=3D"http://www.furnituret=
rainingcompany.com/images/email/highpoint_2009_04/disclaimer_divider.jpg=
" alt=3D"" width=3D"600" height=3D"25" /><br /></td>=0D=0A</tr>=0D=0A</t=
body>=0D=0A</table>=0D=0A<table border=3D"0" cellspacing=3D"0" cellpaddi=
ng=3D"0" width=3D"600" align=3D"center">=0D=0A<tbody>=0D=0A<tr>=0D=0A<td=
valign=3D"top" bgcolor=3D"#ffffff"><img src=3D"http://www.furnituretrai=
ningcompany.com/images/email/highpoint_2009_04/spacer_disclaimer_left.jp=
g" alt=3D"" /></td>=0D=0A<td valign=3D"top" bgcolor=3D"#ffffff"><img src=
=3D"http://www.furnituretrainingcompany.com/images/email/highpoint_2009_=
04/spacer_disclaimer_middle.jpg" alt=3D"" /><br /> <span style=3D"font-s=
ize: xx-small; font-family: Verdana,Arial,Helvetica,sans-serif; color: #=
666666;"><big><big><big><big><small><small><small>If you are not attendi=
ng the High Point market in April but would still like to receive a free=
Road Map to Sales Success poster visit us on the web at <span style=3D"=
text-decoration: underline;"><a class=3D"moz-txt-link-abbreviated" href=
=3D"http://www.furnituretrainingcompany.com">www.furnituretrainingcompan=
y.com</a></span>, or to speak with a Furniture Training Company represen=
tative, call toll free (866) 755-5996. We do not offer free shipping out=
side of the U.S. and Canada. Retailers outside of the U.S. and Canada ma=
y call for more information. Limit one free Road Map to Sales Success pe=
r company. Other copies of the poster may be purchased on our web site.<=
br /> <br /> </small></small></small></big></big></big></big></span> <sp=
an style=3D"color: #666666;"><small><span style=3D"font-size: xx-small;=
font-family: Verdana,Arial,Helvetica,sans-serif;"><big><big><big><small=
><small>We hope you found this message to be useful. However, if you'd r=
ather not receive future emails of this sort from The Furniture Training=
Company, please <a href=3D"http://www.furnituretraining.com/contact">cl=
ick here to unsubscribe</a>.<br /> <br /> </small></small></big></big></=
big></span></small><small><span style=3D"font-size: xx-small; font-famil=
y: Verdana,Arial,Helvetica,sans-serif;"><big><big><big><small><small>&co=
py;Copyright 2009 The Furniture Training Company.<br /> 1770 North Resea=
rch Park Way, <br /> North Logan, UT 84341. <br /> All Rights Reserved.<=
/small></small></big></big></big></span></small></span><br /></td>=0D=0A=
<td valign=3D"top" bgcolor=3D"#ffffff"><img src=3D"http://www.furnituret=
rainingcompany.com/images/email/highpoint_2009_04/spacer_disclaimer_righ=
t.jpg" alt=3D"" /></td>=0D=0A</tr>=0D=0A</tbody>=0D=0A</table>=0D=0A<tab=
le border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"600" align=
=3D"center">=0D=0A<tbody>=0D=0A<tr>=0D=0A<td valign=3D"top" bgcolor=3D"#=
ffffff"><img src=3D"http://www.furnituretrainingcompany.com/images/email=
/highpoint_2009_04/footer.jpg" alt=3D"" /></td>=0D=0A</tr>=0D=0A</tbody>=
=0D=0A</table>=0D=0A<p><br /></p><br><hr><a href=3D'http://localhost/ftc=
/app/unsubscribe.php?action=3DoptOut&pid=3D6121&cid=3D19&email=3Dmarkl#f=
urnituretrainingcompany.com'>Click to Unsubscribe</a>
As it turned out, even though when I copied and pasted the content into the application the necessary DOCTYPE, html, and body tags were in place, TinyMCE was stripping those tags. Which explains why the output only showed the content within the body tag.
I was able to fix the url rewrite problem by ensuring that the DOCTYPE, html and body tags were actually all in place.
And I fixed TinyMCE by adding in the fullpage plugin so that it no longer strips those tags from the input.
There is a configuration option "convert_urls" which can be set to false to prevent URLs from being converted too.
Since #Noah are sending expected content as email. Their is no problem with TinyMCE.
Normally images are blocked by mail hosters.
In my case, I was sending html content(with image) to gmail account. Google blockes images in mails.
Google display the following in every email
Images are not displayed. Display images below - Always display
images from xxxx#xxxx.com
Just click on appropriate link to display images.
Thank You,
Aashish