Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Mar 15, 2012
1 parent 8a9c624 commit 17dfebf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions coldbox/system/logging/appenders/EmailAppender.cfc
Expand Up @@ -8,7 +8,7 @@ Author : Luis Majano
Date : 04/12/2009
Description :
An appender that sends out emails
Properties:
- subject - Get's pre-pended with the category field.
- from - required
Expand All @@ -21,10 +21,10 @@ Properties:
- mailport (optional - 25)
----------------------------------------------------------------------->
<cfcomponent extends="coldbox.system.logging.AbstractAppender"
<cfcomponent extends="coldbox.system.logging.AbstractAppender"
output="false"
hint="An appender that sends out emails">

<!--- Init --->
<cffunction name="init" access="public" returntype="EmailAppender" hint="Constructor" output="false" >
<!--- ************************************************************* --->
Expand All @@ -37,16 +37,16 @@ Properties:
<cfscript>
// Init supertype
super.init(argumentCollection=arguments);

// Property Checks
if( NOT propertyExists("from") ){
throw(message="from email is required",type="EmailAppender.PropertyNotFound");
$throw(message="from email is required",type="EmailAppender.PropertyNotFound");
}
if( NOT propertyExists("to") ){
throw(message="to email(s) is required",type="EmailAppender.PropertyNotFound");
$throw(message="to email(s) is required",type="EmailAppender.PropertyNotFound");
}
if( NOT propertyExists("subject") ){
throw(message="subject is required",type="EmailAppender.PropertyNotFound");
$throw(message="subject is required",type="EmailAppender.PropertyNotFound");
}
if( NOT propertyExists("cc") ){
setProperty("cc","");
Expand All @@ -72,11 +72,11 @@ Properties:
if( NOT propertyExists("useSSL") ){
setProperty("useSSL","false");
}

return this;
</cfscript>
</cffunction>
</cffunction>

<!--- Log Message --->
<cffunction name="logMessage" access="public" output="false" returntype="void" hint="Write an entry into the logger.">
<!--- ************************************************************* --->
Expand All @@ -88,7 +88,7 @@ Properties:
var entry = "";
</cfscript>
<cftry>

<!--- Custom Layout --->
<cfif hasCustomLayout()>
<cfset entry = getCustomLayout().format(loge)>
Expand All @@ -110,7 +110,7 @@ Properties:
</cfoutput>
</cfsavecontent>
</cfif>

<!--- If mail server defined then use mail settings --->
<cfif len( getProperty("mailserver") )>
<!--- Mail the log --->
Expand All @@ -122,8 +122,8 @@ Properties:
useTLS="#getProperty("useTLS")#"
useSSL="#getProperty("useSSL")#"
server="#getProperty("mailserver")#" port="#getProperty("mailport")#"
username="#getProperty("mailusername")#"
password="#getProperty("mailpassword")#"
username="#getProperty("mailusername")#"
password="#getProperty("mailpassword")#"
subject="#subject#" ><cfoutput>#entry#</cfoutput></cfmail>
<cfelse>
<!--- Mail the log --->
Expand All @@ -136,14 +136,14 @@ Properties:
useSSL="#getProperty("useSSL")#"
subject="#subject#"><cfoutput>#entry#</cfoutput></cfmail>
</cfif>

<cfcatch type="any">
<cfset $log("ERROR","Error sending email from appender #getName()#. #cfcatch.message# #cfcatch.detail# #cfcatch.stacktrace#")>
</cfcatch>
</cftry>
</cftry>
</cffunction>

<!------------------------------------------- PRIVATE ------------------------------------------>


</cfcomponent>
Binary file modified favicon.ico
Binary file not shown.

0 comments on commit 17dfebf

Please sign in to comment.