Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm new in Yii2, now I'm using Yii2 with the advance template.
In my project, I need my application can read database using AJAX, and also run in background task. It's like a Cron Job, but I don't know how to do it.
Anyway, I want to integrate sms-gateway services, so when I create some request, it send SMS to user, and user can send SMS to the application with some format. And the SMS from user, it will be used to do another action in my project.
After all, I just can send SMS from my application to user, but cannot read SMS that send from user, and then I can't trigger another action.
Just the same on Yii2 Forum over here!
I got the answer. I use infinite loop with sleep in 1 second. So it will check the database every seconds, that do action that check incoming sms and auto reply the sms.
while (true) {
/*Other script that will read sms , and reply sms*/
sleep(1);
//Or use usleep to use sleep in microsecond
}
more about sleep
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm new to stack overflow but it seems like a good place to ask.
I want my discord bot to send a message in a channel if a website goes down and then another when it comes back up. I don't want it constantly sending messages, only if it receives an error (like a 404, gateway error or if the connection times out) 3 times in a row (to avoid false messages) then another one when it goes back up. I've tried google but had no luck finding anything
Thanks in advance for any help!
You can use the website isitdownrightnow for this. You can get the html code with BeautifulSoup and check if the site is down. Then you can use tasks for checking the website periodically.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We have an app that posts updates to a slack channel. I want to monitor the messages posted to ChannelA and if the text begins with "AAA", then post the whole of the first line of the message "AAA Here is your summary" to ChannelB
Is there a way to do this within Slack? E.g. with Slackbot?
That is not hard to do. Here is one of several valid approaches:
Create you own Slack app with a bot user and subscribe to the message event via Events API
Invite your bot user to the channel you want to monitor
You app will now receive a copy of all message posted to that channel
Detect the messages you are interested in
Post a new message based on the detected message to the new channel, e.g. with chat.postMessage API method
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have one requirement form in my application. So whenever user insert details in requirement form, after submit the mail will go to the particular vendor with link. When vendor clicks on that link, the link will redirect to the login page. After login then vendor gets redirected to vendor dashboard.
So what i want to do is, when ever user insert something in the requirement, the notification will go to the particular vendor dashboard after login like "you have one new requirement" like that
I have no idea on how to do this
After insert give call to sendNotification method which will take the inputs and send the notification with specified message and url to be landed.
I have implemented it using onesignal https://documentation.onesignal.com/docs.
Its very easy to use and implement.
1) Create an onesignal account. https://onesignal.com/
2) Create an google project and get the project id. https://documentation.onesignal.com/docs/web-push-setup
You can achieve this using concept of transaction on codeigniter.If records are successfully inserted into database then send mail withlink as message which redirects to your login page.
Like this..
this->db->trans_begin();//start your transaction
//write queries to insert records into database
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
if ($this->db->trans_status() === FALSE)
{
$this->db->trans_rollback();//rollback if insertion fails
}
else
{
$this->db->trans_commit();//if insertion successful commit transaction
//write code to send mail
}
For more see Codeigniter Transaction
Hope it helps.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am working on a website in Spring, My website gathers info of jobs positions as well the email to which to send applicant resume to (e.g jobs#microsoft.com)
I want users to be able to send emails thru my website to different jobs positions emails, Sending emails thru the website system will send a designed html email to the job email.
So how would I implement it? Should I find unlimited email hosting and create an account for each user? (does that even exist with combination of spring?)
or is there some other way without asking the user for his email and password (nobody in their right mind will trust that.).
what about spam filters? If I create a new domain and open new email accounts will I be considered as spam?
Almost certainly you'll want a single email account to send the messages, but can use the "reply-to" parameter to have replies go to the user sending the application resume if desired. GMail (or other public mailing service) can be configured for this purpose, see the mailSender object and MailManagerImpl class in my open source project for a working example of using Gmail with Spring’s email support.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am having problems with registration on paypal. I need to get and add data to my database when a new use and registers with my website.
Basically the website register new user with a fee. I need register data on paypal pay now button, so you will be redirected to paypal pay page and add data to database at the same time. or when pay successfully.
Any help please, I am using mvc.
I suggest you take a look at the PayPal Instant Payment Notification guide. This product does exactly that; it's an asynchronous server-to-server notification (with validation) which does just that; it notifies you of transactions, both completed and pending, so that you can action them on your end.
Be that by updating your database, XHR and a digital download or sending an email to your buyer.
The best part is that it notifies you long after the fact as well; say, for example, if a buyer files a chargeback case. You'll got notified in that case and will be able to appropriately update the buyer's transaction on your end (revoke permissions to your service, for example).
We have sample IPN sample code up on our GitHub repo.