![]() Those are general thoughts not grounded in what Oban can and can’t do, so I’d love to hear your opinion on how I can use Oban to meet those requirements (I reckon that I may require Oban Pro). All messages for a specific organisation should go through a designated queue so that I can uphold the 1 DM per second limit.Based on those settings I should schedule jobs for sending messages.I’m considering separately storing the preferred message delivery time (or using the default 9 am).Here is how I picture a possible implementation Messages should be delivered at most once per day.People should be able to adjust the time when they want to receive their messages.Messages should go out only during working days.Two other considerations that adds another dimension of complexity: I’m not really worried about the second limit - that would be an excellent problem to have, but it’s not going to crop in any time soon. In the above code snippet, enter the user’s email in the email parameter.I’m working on a daily journal bot for Slack that sends a reminder to all subscribed users to answer two questions at the beginning of their day.įor that, I need to uphold Slack API postMessage limits: ![]() ![]() $userDetails = $client->get(config(' ’)->getBody()->getContents() Send messages to a user’s private account You can get a full list of parameters that used to send message API from here ( ). In the above code snippet, the channel parameter defines the channel name to which the message is sent. $response = json_decode($response, true) $response = $client->post(‘’, $formData)->getBody()->getContents() 'Authorization' => 'Bearer OAuth Access Token, $client = new GuzzleHttp\Client(['headers' => [ You can use any other http client of your choice If you already not installed Guzzle, it can be easily installed by using composer by this command Guzzle is a PHP HTTP client that makes it easy to send HTTP requests. You can add these scopes from the OAuth & Permissions page and you will get all scopes and permission details from here ()Īll configurations are done! then let’s see how to send a message.įor sending requests I am using Guzzle as a client. For this, first we will search the user by email and take the user id from the Api response. To send a message to the user we need to get the user id.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |