Greetings all,
I have created a form to send Email to a select list of customers, and for the most part it is working. All the information is in the Email and the tables are set up correctly.
The issue I am having is that it is not using the css styles thoroughout the Email. All the text is coming out in Times New Roman.
Also I have to images embedded in the Email table and they don't appear to be attached to the Email as well, all I am seeing there is the alternate text and a red x like it can't open the image.
I have never used an Image in APEX before so not sure if I have the syntax correct for inserting images etc... Could someone please take a look at the code I have in my process and maybe see if something jumps right out at you?
I am sure this is a cumbersome way of doing this and if so, any suggestions on how to make it more efficient would also be appreciated.
Thanks so much
Wally
DECLARE
l_body CLOB;
l_body_html CLOB;
BEGIN
l_body := 'To view the content of this message, please use an HTML enabled mail client.'||utl_tcp.crlf;
l_body_html := '<html>';
l_body_html := l_body_html ||'<head>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <style type="text/css">'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style3 {'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-size: 24px;'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-family: Arial, Helvetica, sans-serif;'||utl_tcp.crlf;
l_body_html := l_body_html ||'color: #000000;'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-style: italic;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style4 {'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-family: Arial, Helvetica, sans-serif;'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-size: 14px;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style5 {'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-family: Arial, Helvetica, sans-serif;'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-size: 16px;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style6 {'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-family: Arial, Helvetica, sans-serif;'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-size: 12px;'||utl_tcp.crlf;
l_body_html := l_body_html ||'padding-left:10%;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style7 {'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-family: Arial, Helvetica, sans-serif;'||utl_tcp.crlf;
l_body_html := l_body_html ||'font-size: 10px;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style9 {font-family: Arial, Helvetica, sans-serif; font-size: 9px; padding-top:0px; margin-top:0px; }'||utl_tcp.crlf;
l_body_html := l_body_html ||'.style11 {font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #FF0000;}'||utl_tcp.crlf;
l_body_html := l_body_html ||'a:link {'||utl_tcp.crlf;
l_body_html := l_body_html ||'color: #FF0000;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'.imagefile'||utl_tcp.crlf;
l_body_html := l_body_html ||'{'||utl_tcp.crlf;
l_body_html := l_body_html ||'padding-left:25px;'||utl_tcp.crlf;
l_body_html := l_body_html ||'}'||utl_tcp.crlf;
l_body_html := l_body_html ||'</style>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</head>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<body>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<table width="615" border="0" align="center" cellpadding="0" cellspacing="0" RULES=NONE FRAME=BOX style="cellpadding:0 cellspacing:0">'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<td height="32" colspan="2" bgcolor="#FF0000"><img src="#WORKSPACE_IMAGES#.image001.gif" alt="OurLogo" width="123" height="30" /></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<td colspan="2"> </td>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<td colspan="2"><div align="center"><span class="style3">Service Operations L';
l_body_html := l_body_html || :P6_INCIDENT_LEVEL;
l_body_html := l_body_html ||' Incident Notification</span></div></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td height="25" colspan="2"></td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<td colspan="2"><div align="center">'||utl_tcp.crlf;
l_body_html := l_body_html ||'<table width="484" border="1" align="center" cellpadding="2" cellspacing="1" class="style5">'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td width="20%"><b>Impacted Services</b></td><td>';
l_body_html := l_body_html || :P6_INCIDENT_SERVICES;
l_body_html := l_body_html ||'</td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td width="20%"><b>Impacted Customers</b></td><td>';
l_body_html := l_body_html ||:P6_INCIDENT_CUSTOMERS;
l_body_html := l_body_html ||'</td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td width="20%"><b>Event Description</b></td><td>';
l_body_html := l_body_html ||:P6_INCIDENT_DESCRIPTION;
l_body_html := l_body_html ||'</td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td width="20%"><b>Incident time-line</b></td><td>';
l_body_html := l_body_html ||:P6_INCIDENT_TIMELINE;
l_body_html := l_body_html ||'</td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td width="20%"><b>Incident tracking details</b></td><td>';
l_body_html := l_body_html ||:P6_INCIDENT_TRACKING;
l_body_html := l_body_html ||'</td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </table>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </div></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td height="25" colspan="2"></td></tr> '||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td colspan="2" class="style4"><b>Service Restoration Plan:</b><br></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<td colspan="2" class="style4">';
l_body_html := l_body_html ||:P6_INCIDENT_RESTORE;
l_body_html := l_body_html ||'<br></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"><hr size="2" width="80%" align="center" /></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2" class="style4"><b>Follow Up Actions:</b><br></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2" class="style4">';
l_body_html := l_body_html ||:P6_INCIDENT_FOLLOWUP;
l_body_html := l_body_html ||'<br></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr><td height="25" colspan="2"></td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2" class="style4"><b>Support and Resources</b><br></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2" class="style4">For more information or feedback, please contact the team at<br>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <a href="mailto:myemail\@mydomain.com">MYEMAIL\@MYDOMAIN.COM</a>.<br>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <br>'||utl_tcp.crlf;
l_body_html := l_body_html ||' Thank You,<br>'||utl_tcp.crlf;
l_body_html := l_body_html ||' GIT Service Operations'||utl_tcp.crlf;
l_body_html := l_body_html ||' </td>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"><hr size="1" width="80%" align="center" /></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"><div align="center"><span class="style7">CONFIDENTIAL - MY COMPANY<br />'||utl_tcp.crlf;
l_body_html := l_body_html ||' The information contained in this email communication should not be shared or communicated <br />'||utl_tcp.crlf;
l_body_html := l_body_html ||' outside of My Company. Local entity combinations worldwide will proceed in accordance with local laws.</span><br />'||utl_tcp.crlf;
l_body_html := l_body_html ||' <br />'||utl_tcp.crlf;
l_body_html := l_body_html ||' </div></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"><hr size="2" width="100%" align="left" /></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"> </td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"><div class="imagefile"><img src="#WORKSPACE_IMAGES#.srclip.gif" alt="LOGO" width="229" height="21" border="0" /></div></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td colspan="2"> </td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td height="2" colspan="2" valign="bottom"><hr size="2" width="100%" align="left" /></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td width="276" bordercolor="#FF0000"><span class="style9">Copyright 2010, My Company Corporation <br />'||utl_tcp.crlf;
l_body_html := l_body_html ||'and/or its affiliates. All rights reserved</span></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td width="318"><div align="right"><span class="style11"><a href="http://www.myaddress.com/corporate/contact/" target="_blank">Contact Us</a> | <a href="http://www.myorg.com/html/copyright.html" target="_blank">Legal Notices and Terms of Use</a> | <a href="http://www.myorg.com/html/privacy.html" target="_blank">Privacy Statement</a></span></div></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</table>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<table width="615" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">'||utl_tcp.crlf;
l_body_html := l_body_html ||' <tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<td height="3" colspan="2"><hr size="2" width="100%" align="center" /></td></tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'<tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||' <td height="21" colspan="2" valign="top"><span class="style9">My company<br />'||utl_tcp.crlf;
l_body_html := l_body_html ||'My Address, My City, SS 12345 U.S.A.</span></td>'||utl_tcp.crlf;
l_body_html := l_body_html ||' </tr>'||utl_tcp.crlf;
l_body_html := l_body_html ||'</table>'||utl_tcp.crlf;
apex_mail.send(
p_to => :MYEMAIL,
p_from => :MYEMAIL,
p_body => l_body,
p_body_html => l_body_html,
p_subj => 'L' || :P6_INCIDENT_LEVEL ||' '|| :P6_INCIDENT_TITLE);
END;