Skip to content

Commit

Permalink
fix: Change errorArray to messages in struct returned from Send
Browse files Browse the repository at this point in the history
The docs states the array or errors should be called messages.
This breaks the interface in the docs... and is not compatible with the other 5 providers supplies with CBMailServices.

BREAKING CHANGE: key renamed from `errorArray` to `messages` to be compatible with new version of cbMailServices.
  • Loading branch information
gpickin committed May 20, 2022
1 parent ac85692 commit 4d3684c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/protocols/SendGridProtocol.cfc
Expand Up @@ -22,7 +22,7 @@ component extends="cbmailservices.models.AbstractProtocol" {
* @payload The payload to deliver
*/
public function send( required cbmailservices.models.Mail payload ) {
var rtnStruct = {error=true, errorArray=[], messageID=''};
var rtnStruct = {error=true, messages=[], messageID=''};
var mail = payload.getMemento();

var body = {
Expand Down Expand Up @@ -121,7 +121,7 @@ component extends="cbmailservices.models.AbstractProtocol" {
};

if ( left( cfhttp.status_code, 1 ) != "2" && left( cfhttp.status_code, 1 ) != "3" ) {
rtnStruct.errorArray = deserializeJSON( cfhttp.filecontent ).errors;
rtnStruct.messages = deserializeJSON( cfhttp.filecontent ).errors;
}
else {
rtnStruct.error = false;
Expand Down

0 comments on commit 4d3684c

Please sign in to comment.