Trigger Scheduled Events from Yii2 - yii2

Scenario
I am making a small Web application based on Yii2.
There are 2 entities 'User' and 'Admin' in my system.
Required solution for:
I want to know if there is any facility in Yii2 where I can trigger Scheduled Events like creating User Registration expiry, promotional emails and stuff ?
Currently I am triggering event when Admin logs in, but I want this Scheduled irrespective of whether Admin logs in or not.

Just create an action in console controller which will handle events and execute it regularly using CRON.

Related

How to create Firebase Cloud messaging recurring notifications without console?

From FCM console I can not set up much more than 10 recurring notifications.
You can have up to 10 unique recurring notifications active per
project
I want to aim targeting audiences, user properties, last user engagement also. For example, you can set up a recurring notification that sends a push notification to a user who has been inactive for 2 days. From FCM console it is possible but I want to set it up manually since FCM console does not allow me to create recurring notifications much more than 10.
There is no API to create recurring notifications in Firebase Cloud Messaging. Since you already tagged your question with google-cloud-functions, you seem to know that you can create scheduled tasks with that.
To create a scheduled, recurring notification you can:
either run a function on a PubSub schedule or enqueue functions with Cloud Tasks, and
combine that with notifying the user when something interesting happens
From this documentation and the examples in it, you should be able to get the use-case working. If not, post another question with the minimal, complete code that any of us can run to reproduce where you got stuck.

Azure API Management subscription event

When a developer ask to subscribe to a particular API product in the Dev Portal, if I checked the 'need approval' option, a workflow is created and the subscription is waiting to be approved by the administrator.
I have a use case where I need to do additional tasks before the approval, in particular I need to create an App in the AD for OAuth2 and set the right permissions.
I'm looking for a way to trigger a Power Automate workflow when a subscription is requested, then use the content of the event to execute tasks and then ask a user to approve the requested subscription (thanks to a Power Automate approval).
Unfortunately, the only way to be informed that a product subscription was requested is to receive an email and unfortunately, the content of this email cannot be customized. The default email content is not really useful to detect what subscription is about and to find additional settings.
Any ideas to manage this?
Here is a walkthrough which uses the Logic App to customize the subscription approval workflow. It might be helpful for your case as well. Check it out: https://github.com/adamhockemeyer/Azure-API-Management-Custom-Subscription-Approval

How to reload gmail add-on through background process using app-script

May i get some help on the below points where i am using app-script to develop a gmail add-on:
How can we refresh gmail add-on with back ground process?
=> Here is my case, I need to display card with multiple sections which is the process of hitting multiple apis to fetch data and to display the card. For this initially we will show a card with minimal information to the user once i get information from api, i need to update the basic cards with complete information.
How can we trigger a function on every mail thread open?
=> Currently it works once for a mail, here as explained above point need to refresh a card once we fetch the data. If not, user will be seeing same basic information card every time he opens the mail.
From above mentioned issues for point one we are trying to get solution where we can hit service for certain interval of time to check data availability and if data exists then fetch data and update cards, i mean to say need a setTimeout function kind of thing, unfortunately we did'nt found this in app script and We found sleep/waitLock functions in app-script, but my services may take little time to fetch data as it connects though multiple services so we cant make the user to wait until the whole process is to be completed. So that we will show a card with basic information required then after need to auto refresh the cards once we fetch the data. we tried of keeping refresh button for the user to click and fetch the updated data but here we are losing user experience, trying for auto refresh with out user interference to get updated information.
Need a process / solution where we can auto refresh the card with out user interference after the data available at our end instead of making user to wait until the process to be completed.
Earliest reply will be more helpful for us.
Thanks.
If a data status on a third-party backend changes as the result of a user interaction with your add-on UI, it is recommended that the add-on set a 'state changed' bit to true so that any existing client side cache is cleared. See the ActionResponseBuilder.setStateChanged() method description for additional details.
The card-based interface in Gmail Addons is an Apps Script Service.
You can interlink it with other Apps Script services as well as implement API calls - everything within the same Apps Script file.
Gmail Addons contents automatically update every time the user opens a different e-mail or refreshes his browser.
Within your Apps Script code you can install time-driven triggers to run the data availability check with a customized frequency.
Consider to install for your users an Auto Refresh extension if you do not want them to refresh the card themselves.

How to prevent user log in from two devices

I am developing mobile application in ionic 2. I want to design mechanism when user log in my website i must log out from my mobile application at the same time if user logged in mobile application then website must be log out. I am using same database for mobile and website. I am using jsonwebtoken for my mobile authentication. what is the best way to implement this mechanism in my ionic 2 application.
you will need to create a session table that will store the session details and will also store the unique ID and status that will be used to identify these sessions and tell us weather it is active or not. This id will be used as a reference to validate session for different devices, once the user logs in you will query into this table and check whether any existing session is there or not. If it is there change the status to false.
In the UI you will use setinterval to request for this session at regular time it can be 10 seconds or anything based on your requirement then inside setinterval make a call to backend that will be checking this session, if this session status is false then logout.

Notification When user add item into database

i have a program that allow user to add data into database,but i want it look proper to admin to view the new item. Right now when user submit new data the admin can view all the data have been submitted from database but now i want the admin can alert the new data have been submitted by user. By the way i using asp.net,back end Vb.net and db is MYSQL.
There are huge variety of ways how you could implement desired feature. General algorithm is next
Commit each user data sumbission event into storage
Gather all events by timer
Render gathered facts in admin UI
To achieve this consider to use for step 1 MySQL triggers. Create additional table and save user data submission events into it.
Use scheduled asynchronous event monitoring for step 2,