-
Posts
284 -
Joined
-
Last visited
Everything posted by gutterboy
-
Ok, seems the issue was because the from address wasn't a real email address; once I changed it to a real email address it worked fine.
-
Ok, found this: http://www.blesta.com/forums/index.php?/topic/1021-staff-password-reset/ All good now after getting the link from the log_emails table.
-
Well yeah......... pretty useless if users all had the same salt haha...... as then they would have the same hash anyway.
-
Well isn't the point of salts to avoid having users with the same password getting the same hash?
-
Doesn't it use a salt?
-
Is there any manual way I can do it? I really need to get in there lol
-
Yes, all other mails work fine. I get invoices no problems.
-
Interesting - I think this may have something to do with the license. I just tried it on my "owned" license and it worked, but it will not work on my "dev" license. How do I reset my password on a dev license installation?
-
I have lost my password for my admin account and I used the reset password form but I am not getting any emails. I even tried changing my email in the database to something different and I didn't get anything.
-
Ok thanks for that.
-
I'm just wondering when the "Transactions.add" event is triggered, I am currently doing something like this: public function getEvents() { return array( array( 'event' => "Transactions.add", 'callback' => array("this", "notify") ), array( 'event' => "Transactions.edit", 'callback' => array("this", "notify_edit") ) ); } public function notify($event) { // Get params $params = $event->getParams(); // Set transaction id $transaction_id = $params['transaction_id']; if (!isset($this->Transactions)) { Loader::loadModels($this, array("Transactions")); } // Now get transaction details $transaction_details = $this->Transactions->get($transaction_id); ......... } Now, I'm wondering if there is anyway at all for me to get their amount due at the time they made this transaction (meaning their debits not including their current credits)? I know of the amountDue method which can be used via the API, but obviously if I run this it will get the amount due AFTER their payment from this transaction has been applied correct? ..... also, does their amount due only go down once a payment has been APPLIED? Last question....... are there any events that get triggered when a payment is APPLIED to an account? So that you don't get notifications for loose credits until they are actually applied? Thanks!
-
I'm not sure how that would work? Isn't that more for database changes etc?
-
Ok, figured the problem out. If you make any changes to the plugin AFTER you install it, you need to first UNINSTALL it and then INSTALL it again.
-
So I don't need to register it first? Yes I'm sure they aren't being triggered. What I'm doing is I'm recording a payment for a client via admin which adds it to the transactions - if I call the method "run" then it will trigger it (which I can tell as it updates the output.txt file; if I change the name of the method and run that scenario again, the file isn't updated. Same goes for editing a transaction via admin - no creation of output_edit.txt.
-
It was this one: http://docs.blesta.com/display/dev/Plugin+Events But I just had a look at: http://docs.blesta.com/display/dev/Creating+Events and it seems more clear now. So basically I will need to register the callbacks to that event so they get triggered? As for specifying the class, I thought that what was the "this" referred to, so it was a reference to "$this".
-
Well from what I understood from the docs was that by doing something like what I am doing it should use the callback of $this->notify or $this->notify_edit as it works when I name the method "run" as that is $this->run no?
-
I am having problems with triggering the method unless I name the method name run. For example I have this code: public function getEvents() { return array( array( 'event' => "Transactions.add", 'callback' => array("this", "notify") ), array( 'event' => "Transactions.edit", 'callback' => array("this", "notify_edit") ) ); } public function notify($event) { // Get params $params = $event->getParams(); // Set transaction id $transaction_id = $params['transaction_id']; if (!isset($this->Transactions)) { Loader::loadModels($this, array("Transactions")); } // Now get transaction details $transaction_details = $this->Transactions->get($transaction_id); file_put_contents(dirname(__FILE__) . '/output.txt', print_r($transaction_details, true)); } public function notify_edit($event) { // Get params $params = $event->getParams(); // Set transaction id $transaction_id = $params['transaction_id']; if (!isset($this->Transactions)) { Loader::loadModels($this, array("Transactions")); } // Now get transaction details $transaction_details = $this->Transactions->get($transaction_id); file_put_contents(dirname(__FILE__) . '/output_edit.txt', print_r($transaction_details, true)); } This will not trigger the notify method at all; however if i change the method name to run it will trigger it. Another problem is I cannot get the Transactions.edit method to run. I even changed the name of the method to run but it never would trigger. Help!
-
Great - thanks!
-
When a transaction is added with a status of "pending" I assume that triggers the Transactions.add event, but I'm wondering, if and when that transaction changes to "Approved" will that then trigger the Transactions.edit event?
-
Thanks to you both.
-
That worked but I had to change: $this->Transactions->getByTransactionId($transaction_id); to.. $this->Transactions->get($transaction_id);
-
Awesome - thank you!
-
Hmmmmmm....... why doesn't the var_dump() output the object data then? Anyway....... I tried those and it didn't give me much information; $event->getParams() just returned an ID, which I assume is the id of the transaction?
-
I'm trying to create something so that when a transaction is created I trigger another function, which is working, but I'm having trouble understanding how to get the event details of the transaction. For example, in my plugin handler file I have this: public function getEvents() { return array( array( 'event' => "Transactions.add", 'callback' => array("this", "run") ) ); } public function run($event) { ob_start(); var_dump($event); $content = ob_end_clean(); file_put_contents(dirname(__FILE__) . '/output.txt', $content); } All I get in the contents of output.txt is: 1 How can I get the event details such as how much they paid etc?