--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/d2213d78-cc9f-4d1b-96c2-89abdf06e69b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<cfcomponent output="false">
<!--- CONSTRUCTOR --->
<cffunction name="init" access="public" returntype="any" output="false">
<cfscript>
return this;
</cfscript>
</cffunction>
<!--- MESSAGES --->
<cffunction name="sendMessage" access="public" returntype="string" output="false">
<cfreturn true />
</cffunction>
</cfcomponent>
Since the empty component can be instantiated, you could remove functions one at a time and see when the error goes away. Then you know there’s something in that function that Lucee chokes on. If you’ve found that function, comment out lines inside that function until there’s no error. That should give you the line where things go wrong. Could you post that line back here if you find it?
<cffunction name="validate" access="public" returntype="boolean" output="false"> <cfargument name="address" type="string" required="true" />
<cfscript>
_setApiKey( "pubkey-460ik78fbe8bu471dfsr9wtpf53gl4m6" ); var getVars = {};
if ( Len( Trim( arguments.address ) ) ) { getVars.address = arguments.address; };
var result = _restCall( httpMethod = "GET" , uri = "/address/validate" , getVars = getVars );
if ( IsStruct( result ) and StructKeyExists( result, "is_valid" ) ) { return structFind(result, "is_valid"); }
_throw( type = "unexpected" , message = "Unexpected mailgun response. Expected a validate object (structure) but received [#SerializeJson( result )#]" , errorCode = 500 ); </cfscript> </cffunction>
<cffunction name="sendMessage" access="public" returntype="string" output="false" hint="Attempts to send a message through the MailGun API - returns message if successul and throws an error otherwise">
<cfargument name="from" type="string" required="true" />
<cfargument name="to" type="string" required="true" />
<cfargument name="subject" type="string" required="true" />
<cfargument name="text" type="string" required="true" />
<cfargument name="html" type="string" required="true" />
<cfargument name="cc" type="string" required="false" default="" />
<cfargument name="bcc" type="string" required="false" default="" />
<cfargument name="attachments" type="array" required="false" default="#ArrayNew(1)#" />
<cfargument name="inlineAttachments" type="array" required="false" default="#ArrayNew(1)#" />
<cfargument name="domain" type="string" required="false" default="#_getDefaultDomain()#" />
<cfargument name="testMode" type="boolean" required="false" default="false" />
<cfargument name="tags" type="array" required="false" default="#ArrayNew(1)#" />
<cfargument name="campaign" type="string" required="false" default="" />
<cfargument name="dkim" type="string" required="false" default="" />
<cfargument name="deliveryTime" type="string" required="false" default="" />
<cfargument name="tracking" type="string" required="false" default="" />
<cfargument name="clickTracking" type="string" required="false" default="" />
<cfargument name="openTracking" type="string" required="false" default="" />
<cfargument name="customHeaders" type="struct" required="false" default="#StructNew()#" />
<cfargument name="customVariables" type="struct" required="false" default="#StructNew()#" />
<cfscript>
var result = "";
var files = {};
var postVars = {
from = arguments.from
, to = arguments.to
, subject = arguments.subject
, text = arguments.text
, html = arguments.html
};
if ( Len( Trim( arguments.cc ) ) ) {
postVars.cc = arguments.cc;
}
if ( Len( Trim( arguments.bcc ) ) ) {
postVars.bcc = arguments.bcc;
}
if ( _getForceTestMode() or arguments.testMode ) {
postVars[ "o:testmode" ] = "yes";
}
if ( ArrayLen( arguments.tags ) ) {
postVars[ "o:tag" ] = arguments.tags;
}
if ( Len( Trim( arguments.campaign ) ) ) {
postVars[ "o:campaign" ] = arguments.campaign;
}
if ( IsBoolean( arguments.dkim ) ) {
postVars[ "o:dkim" ] = _boolFormat( arguments.dkim );
}
if ( IsDate( arguments.deliveryTime ) ) {
postVars[ "o:deliverytime" ] = _dateFormat( arguments.deliveryTime );
}
if ( IsBoolean( arguments.tracking ) ) {
postVars[ "o:tracking" ] = _boolFormat( arguments.tracking );
}
if ( IsBoolean( arguments.clickTracking ) ) {
postVars[ "o:tracking-clicks" ] = _boolFormat( arguments.clickTracking );
} elseif( arguments.clickTracking eq "htmlonly" ) {
postVars[ "o:tracking-clicks" ] = "htmlonly";
}
if ( IsBoolean( arguments.openTracking ) ) {
postVars[ "o:tracking-opens" ] = _boolFormat( arguments.openTracking );
}
for( var key in arguments.customHeaders ){
postVars[ "h:X-#key#" ] = arguments.customHeaders[ key ];
}
for( var key in arguments.customVariables ){
postVars[ "v:#key#" ] = arguments.customVariables[ key ];
}
if ( ArrayLen( arguments.attachments ) ) {
files.attachment = arguments.attachments;
}
if ( ArrayLen( arguments.inlineAttachments ) ) {
files.inline = arguments.inlineAttachments;
}
result = _restCall(
httpMethod = "POST"
, uri = "/messages"
, domain = arguments.domain
, postVars = postVars
, files = files
);
if ( StructKeyExists( result, "id" ) ) {
return result.id;
}
_throw(
type = "unexpected"
, message = "Unexpected error processing mail send. Expected an ID of successfully sent mail but instead received [#SerializeJson( result )#]"
);
</cfscript>
</cffunction>
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/6qfZ6Lk7ncc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/022c8019-ae39-4d6d-bb05-cc5473b21234%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/78F505CA-53B9-4778-8E7B-FB16A866259C%40neoneo.nl.
if ( IsDate( arguments.deliveryTime ) ) {
postVars[ "o:deliverytime" ] = _dateFormat( arguments.deliveryTime );
}