apostle / apostle-php Goto Github PK
View Code? Open in Web Editor NEWPHP Bindings for Apostle.io
Home Page: http://apostle.io
PHP Bindings for Apostle.io
Home Page: http://apostle.io
Here is a test case:
// Set a incorrect domain key
Apostle::setup("incorrect_key_entered");
// Create a mail instance
$mail = new Mail( "welcome", ["email" => "[email protected]" ] );
// Add any values our template needs
$mail->username = "Snikch";
// Send to Apostle.io
$result = $mail->deliver($failureMsg);
echo $result ? "all ok" : "Something failed: $failureMsg\n";
It prints "all ok". Would be better if we could get a error message saying domain key is incorrect.
Here is a test case:
// Set a valid domain key
Apostle::setup("valid-key-entered-here");
// Create a mail instance. Ensure the mail template needs some data
$mail = new Mail( "welcome", ["email" => "[email protected]" ] );
// Give some data but NOT what the template needs
$mail->username = "Snikch";
// Send to Apostle.io
$result = $mail->deliver($failureMsg);
echo $result ? "all ok" : "Something failed: $failureMsg\n";
It prints "all ok".
The apostle.io web-console shows the failure reason nicely:
Failed to hydrate template, check your template and data variables match
Would be better if we could get a error message from the API call saying the same message as the web-console gives us.
Here is a test case:
// Set a valid domain key
Apostle::setup("valid-key-entered-here");
// Create a mail instance. Ensure the mail template used doesn't need any data
$mail = new Mail( "welcome", ["email" => "[email protected]" ] );
// Send to Apostle.io
$result = $mail->deliver($failureMsg);
echo $result ? "all ok" : "Something failed: $failureMsg\n";
It prints "all ok".
There are 3 problems happening:
The apostle.io web-console shows the following reason for failing:
Failed to hydrate template, check your template and data variables match
However this isn't a true error message because my "welcome" template (which I edited from the demo) doesn't have any template variables.
If you thern add any data item, even if the template doesn't need any, the mail will send ok.
$mail->anythinghere = "any value";
So it seems apostle needs some data, even if not used, before it'll send.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.