Git Product home page Git Product logo

apostle-php's People

Contributors

snikch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pallaviveerla

apostle-php's Issues

No Error when a invalid domain key is used

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.

No Error when invalid data is passed to a template

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.

No Error when message fails due to no data

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:

  1. The message fails to be delivered even though it's valid.
  2. The delivery returns true, but should be false.
  3. The apostle.io web-console shows the wrong delivery failure message.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.