-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
67 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
POSTMARK_API_KEY= | ||
MAILGUN_API_KEY= | ||
MAILGUN_DOMAIN= | ||
MAILGUN_BASEURL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3.2.0 | ||
|
||
- uses: Ortus-Solutions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,19 @@ jobs: | |
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ] | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3.2.0 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v3.9.0 | ||
with: | ||
distribution: "adopt" | ||
distribution: "temurin" | ||
java-version: "11" | ||
|
||
- name: Setup CommandBox CLI | ||
uses: Ortus-Solutions/[email protected] | ||
|
||
- name: Cache CommandBox Dependencies | ||
uses: actions/cache@v1 | ||
uses: actions/cache@v3 | ||
if: ${{ true }} | ||
with: | ||
path: ~/.CommandBox/artifacts | ||
|
@@ -67,15 +67,15 @@ jobs: | |
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
files: test-harness/tests/results/**/*.xml | ||
junit_files: test-harness/tests/results/**/*.xml | ||
check_name: "${{ matrix.cfengine }} Test Results" | ||
|
||
- name: Upload Test Results to Artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: test-results-${{ matrix.cfengine }} | ||
path: | | ||
|
@@ -90,7 +90,7 @@ jobs: | |
- name: Upload Debug Logs To Artifacts | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: Failure Debugging Info - ${{ matrix.cfengine }} | ||
path: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name":"ColdBox Mail Services", | ||
"version":"2.6.2", | ||
"version":"2.7.0", | ||
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbmailservices/@build.version@/[email protected]@.zip", | ||
"author":"Ortus Solutions.com <[email protected]", | ||
"slug":"cbmailservices", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
* - apikey : The mailgun secret api key | ||
* - domain : The mailgun domain to send the email through | ||
* | ||
* An optional property, "baseURL" is required when using an EU region | ||
* - baseURL : The mailgun region where the Mailgun domain was created | ||
* | ||
* @author Scott Steinbeck <[email protected]> | ||
*/ | ||
component | ||
|
@@ -24,7 +27,6 @@ component | |
MailgunProtocol function init( struct properties = {} ){ | ||
variables.name = "Mailgun"; | ||
variables.DEFAULT_TIMEOUT = 30; // in seconds | ||
variables.MAILGUN_APIURL = "https://api.mailgun.net/v3/"; | ||
// super size it | ||
super.init( argumentCollection = arguments ); | ||
|
||
|
@@ -40,6 +42,14 @@ component | |
throw( message = "ApiKey is Required", type = "MailgunProtocol.PropertyNotFound" ); | ||
} | ||
|
||
// Check for Base URL property | ||
if ( !propertyExists( "baseURL" ) ) { | ||
// No baseURL key was found, so use the US default. | ||
variables.MAILGUN_APIURL = "https://api.mailgun.net/v3/"; | ||
} else { | ||
variables.MAILGUN_APIURL = getProperty( "baseURL" ); | ||
} | ||
|
||
return this; | ||
} | ||
|
||
|
@@ -101,7 +111,7 @@ component | |
data.delete( "bodyTokens" ); // cleanup payload | ||
|
||
// Process the mail attachments and encode them how mailgun likes them | ||
attachments = arguments.payload | ||
var attachments = arguments.payload | ||
.getMailParams() | ||
.filter( function( thisParam ){ | ||
return structKeyExists( arguments.thisParam, "file" ); | ||
|
@@ -185,7 +195,14 @@ component | |
} | ||
|
||
// Inflate HTTP Results | ||
var mailgunResults = deserializeJSON( httpResults.fileContent.toString() ); | ||
if( isJSON( httpResults.fileContent.toString() ) ) { | ||
var mailgunResults = deserializeJSON( httpResults.fileContent.toString() ); | ||
} else { | ||
results.messages = [ 'Error sending mail. Mailgun returned "#httpResults.fileContent.toString()#".' ]; | ||
|
||
return results; | ||
} | ||
|
||
// Process Mailgun Results | ||
if ( mailgunResults.message eq "Queued. Thank you." ) { | ||
results.error = false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters