# |
Jul 18th 2019, 12:33 |
noel |
I should point out that the same request made via Postman works but it doesn't work via axios. |
# |
Jul 18th 2019, 12:28 |
noel |
Hi. I'm working with the friendsofcake/CRUD plugin. I'm having a problem with DELETE messages, where it's hitting pre-flight check OPTIONS and failing. Not sure whether I need to configure CakePHP or axios to fix this, nor how? |
# |
Jul 18th 2019, 12:22 |
acosonic |
@neon1024 suggestion to use sendgrid is good for mass mailing |
# |
Jul 18th 2019, 12:21 |
acosonic |
@davorminchorov as I say... A watcher to watch for that in logs, then retry once timeout occcurs, however with gmail you have limitations, like 2000 messages per day... |
# |
Jul 18th 2019, 11:50 |
davorminchorov |
@neon1024 nope, only timeout in the logs |
# |
Jul 18th 2019, 11:49 |
slackebot |
<info356> |
# |
Jul 18th 2019, 11:43 |
neon1024 |
I guess you can’t check the response as you don’t get one right? |
# |
Jul 18th 2019, 11:43 |
davorminchorov |
Yeah that's something that I'll work on later on but it's weird that it timeouts randomly |
# |
Jul 18th 2019, 11:40 |
neon1024 |
All I could suggest would be using a message queue, so if it times out the worker re-adds the message to the queue to try again |
# |
Jul 18th 2019, 11:40 |
davorminchorov |
20-30 seconds I think, and then NGINX timeouts |
# |
Jul 18th 2019, 11:39 |
neon1024 |
@davorminchorov How long do you wait for a timeout? |
# |
Jul 18th 2019, 11:38 |
davorminchorov |
Yeah, this app will send a ton of emails and I don't have time to fight with spam |
# |
Jul 18th 2019, 11:38 |
neon1024 |
Ah :face_palm: I see my mistake in my unit test now! |
# |
Jul 18th 2019, 11:37 |
neon1024 |
@davorminchorov Just for balance I’m the total opposite of @acosonic and would never setup my own mail server for sending email, and would instead use a service like Sendgrid |
# |
Jul 18th 2019, 11:36 |
acosonic |
@davorminchorov anything that you have full control and responsibility of... If it's mail server, then it means making your own stmp, and ensuring it gets 10/10 on mail-tester.com ... |
# |
Jul 18th 2019, 11:35 |
neon1024 |
When unit testing, do I have to declare a schema for a table? It seems to be missing, but I am not mocking the table class, and I’m using a fixture |
# |
Jul 18th 2019, 11:35 |
acosonic |
I guess that you would need some kind of log analyser to ensure google did it's part |
# |
Jul 18th 2019, 11:35 |
davorminchorov |
what would you suggest for enterprise? |
# |
Jul 18th 2019, 11:34 |
acosonic |
for enterprise use... |
# |
Jul 18th 2019, 11:34 |
acosonic |
including gmail... |
# |
Jul 18th 2019, 11:34 |
acosonic |
@davorminchorov I'm avoiding cloud anything, at all costs :) |
# |
Jul 18th 2019, 11:33 |
davorminchorov |
Anyone ever had issues sending emails via Gmail from their apps where there were connection timeouts from time to time in some cases? Is this possible to fix somehow? |
# |
Jul 18th 2019, 11:33 |
acosonic |
@conehead first solution worked |
# |
Jul 18th 2019, 11:21 |
conehead |
Or you could make that default array static. Then you could access it via EmailConfig::default |
# |
Jul 18th 2019, 11:20 |
acosonic |
I'll test with var-dumping... |
# |
Jul 18th 2019, 11:20 |
conehead |
You need to instantiate that class if you want to get the data. (new EmailConfig())->default; |
# |
Jul 18th 2019, 11:19 |
neon1024 |
Would be my first guess |
# |
Jul 18th 2019, 11:19 |
neon1024 |
`$Email->getConfig()` |
# |
Jul 18th 2019, 11:08 |
acosonic |
Hi everyone, how can I read data from class EmailConfig { public $default = array( Should I somehow include that class? I want to get values from within default array... |
# |
Jul 18th 2019, 10:58 |
neon1024 |
If you need to assign to a protected property |
# |
Jul 18th 2019, 10:58 |
neon1024 |
I think you can also modify the property as part of either save() or patchEntity(), I don’t recall which one |
# |
Jul 18th 2019, 10:57 |
neon1024 |
You could just add the property to your extending entity |
# |
Jul 18th 2019, 10:37 |
mikemack |
protected function _setRole($value) { $this->set($value, ['role' => false]); } |
# |
Jul 18th 2019, 10:35 |
mikemack |
Work with cakedc user plugin. I modify the user table, and follow https://github.com/CakeDC/users/blob/master/Docs/Documentation/Extending-the-Plugin.md#extending-the-model-tableentity And on the MyUser Entity, how to disable the |
# |
Jul 18th 2019, 10:27 |
dereuromark |
not sure, arent there still cases where you - without fields list - would be allowed to mass assign then too much? I just use explicit fields always here. |
# |
Jul 18th 2019, 10:23 |
slackebot |
user is admin if ($user->isAdmin()) { $userToUpdate->accessible('role, true); } // proceed as usual $this->Users->patchEntity($userToUpdate, $data) ``` You think this would be a suitable solution? |
# |
Jul 18th 2019, 10:23 |
conehead |
Yes sure. Was just thinking about how to do it without editing the whitelist every time I add a property. Depending @felix.robaglia problem It should be possible to set the `$_accessible` `role => false` and before patching the entity in the controller you check if the current user has the rights to change the role. If yes, you could make that field accessible. ``` $data = $this->getRequest()->getData(); // allow to update role if current |
# |
Jul 18th 2019, 10:09 |
dereuromark |
in general a whitelist is usually always safer than blacklists. |
# |
Jul 18th 2019, 10:08 |
dereuromark |
no, that is all cachd. |
# |
Jul 18th 2019, 10:07 |
conehead |
Hm schema by accessing the database? This could allow values that are restricted via `accessible` |
# |
Jul 18th 2019, 09:23 |
dereuromark |
i might have made a convienience method for this in tools or shim plugin maybe |