How To Get Free SMS Alerts for New Comments at Your Blog

Punniya seelan
0


Enable free SMS alert at Google calendar



1. Login to Google calendar with the same Gmail address that you have into your WordPress profile.




2. Click on the Gear sign from the top-right corner of the page and select “Settings” from the drop-down.




3. Click on the “Mobile Setup” link.




4. By default, the Phone notification is disabled. To enable the service, select your country (leave if it is set by default), give your mobile phone number (without any ‘0’ or country code before the number; Google will automatically select that for your country) and then tap the “Send Verification Code” button. Once you do that, Google will send the verification code at your mobile. Grab the code and input that at the proper place and tap the “Finish Setup” button.




Press the Save button and you are done with the Google Calendar setup.


Setup your Gmail account for the SMS alert for new blog comments



Now, it is time to prepare your Gmail account for receiving the SMS alerts for the blog comments.


1. Open the Gmail account and create a label as “WordPress comments“. You can do that from the “Settings (Gear icon at the top-right corner of the page) > Labels > Create new label”.




2. Now flip to the “Filter” tab under the “Settings” page and click on “Create a new filter” link from the bottom of the page.




3. At the filter setup box put “wordpress@yoursite.com” at the “From” field (replace yoursite.com with your own blog address) and click the “Create filter with this search” link.




4. Now check the box labeled as “Apply the label:” and select “WordPress comments” from the drop-down box.




Finally, click the “Create Filter” button.


That’s all with your setup regarding the Gmail account.


Preparing the script



After you are ready with setting up Google Calendar and Gmail, you will have to go through a simple coding part. Don’t worry!! We’ll guide you and it’s not tough as much as you are guessing.


Open Google Docs and create a new spreadsheet using the “Create” button and follow the steps below:


1. Select Tools > Script editor from the menu.




2. The “Google Apps Script” box opens. Choose the “Blank Project” option.




The workspace opens. Delete every thing from the code.gs page.


3. Now copy and paste the following code.

function sendSmsAlerts() {
var label = GmailApp.getUserLabelByName('WordPress comments');
var threads = label.getThreads();
var now = new Date().getTime();
for(i in threads){
CalendarApp.createEvent('IMP- '+threads[0].getFirstMessageSubject(),
new Date(now+60000),
new Date(now+60000)).addSmsReminder(0);
}
label.removeFromThreads(threads);
}


[Reference]


4. Save the project with suitable name.


5. Now click on the Run icon. As long as you do that, an authorization request box will appear.




Authorize it by clicking the right button. Another authorization page will appear asking you to grant the access of your Gmail account by the code you have written. Simply, grant it and press the “Close” button.




6. Again, return to the Script Editor and select Resources > Current script’s triggers…




The “Current project’s triggers” dialog box opens. Click the link as shown into the picture below.




7. Make sure that the function sendSmsAlerts and the event “Time-driven” are selected.




8. Choose the triggering time according to your need. You can set the triggering time every hour, every minutes etc.


9. Press the “Save” button and you’re done!


You’ll start to receive Free SMS Alert for New Blog Comments.


How does the total system work



Whenever a reader of your blog submit any comments at your posts through the comment for of your WordPress blog, WordPress sends an email alert to the email address of the admin as well as the author of the post. Now the Gmail filter, you’ve created earlier filters those emails and apply the aforementioned label.


Now the script is running with your account and simultaneously checking for the emails with that label. If it finds any match, it immediately send the SMS alert through Google Calendar.


Conclusion:


Not only the blog comments but also you can setup SMS alerts for contact form submission, submission of articles for review by the authors etc.


I found this way very helpful. What about you? Drop your words at the comment section.


Post a Comment

0Comments

Post a Comment (0)