ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Gmail to SMS - (and any loud, annoying iPad notification method)

<< < (2/4) > >>

Steven Avery:
This is a promising idea.  Checking it out a bit.

4wd:
You can use PowerShell to retrieve your Gmail, filter only those you're interested in and then send a push notification.

I use Gotify as a Push server which keeps it all under my control. They only have an Android client though.

https://github.com/gotify/server

I use Bash and PowerShell scripts that call Gotify when they finish a process.

wraith808:
That looks pretty cool... requires you to run your own server though, which for some people doesn't work.

4wd:
Addendum: added info for Pushetta notification, (a completely free service).

NOTE: Gotify - Android only client (not likely to be a iOS app due to how app store works)
Pushetta - Android and iOS clients

Original GMail script courtesy the author noted, I've added the few additions for the Gotify notification.  You'd want to loop it, apply your filter, compare last email ID to make sure you're not resending a push notification, and probably tidy it up by putting things in functions, etc but that's all relatively simple.


--- Code: PowerShell ---#-------------------------------------------------------------------------------# Name:        get_gmail.ps1# URL:         http://gallery.technet.microsoft.com/scriptcenter/Get-new-gmail-emails-a0aa3db8## Purpose:     Get new email headers from gmail - read only.## Usage:       Enter username and password the first time which will be saved.## Author:      Amir Hanna## Created:     20/07/2014# Copyright:   Public domain# Version:     2#------------------------------------------------------------------------------- $script_folder = Split-Path $MyInvocation.MyCommand.Path$username_file = ($script_folder + "\user")$pass_file = ($script_folder + "\pass") if ( !(Test-Path -LiteralPath $username_file -PathType Leaf) -or !(Test-Path -LiteralPath $pass_file -PathType Leaf) ) {  Write-Host "Please type a username: "  Read-Host | Set-Content -LiteralPath $username_file    Write-Host "Please type a password: "  Read-Host -AsSecureString | ConvertFrom-SecureString > $pass_file} $username = Get-Content $username_file$pass = Get-Content $pass_file | ConvertTo-SecureString $credentials = New-Object System.Management.Automation.PsCredential($username, $pass) $webclient = new-object System.Net.WebClient$webclient.Credentials = $credentials [xml]$xml= $webclient.DownloadString("https://mail.google.com/mail/feed/atom") if (!$xml) { return } Write-Host -BackgroundColor Red -ForegroundColor White "You have", $xml.feed.fullcount, "new emails." $format= @{Expression={[string][System.Math]::Round(((get-date) - (Get-Date $_.issued)).TotalHours, 1) + " hours"};`         Label="Received since"; Width=20}, @{Expression={$_.author.name}; Label="From"; Width=20},`         @{Expression={$_.title}; Label="Subject"}, @{Expression={$_.summary}; Label="Summary"} $xml.feed.entry | format-table $format -wrap  <# ----------------------------- #># Added stuff for Gotify/Pushetta Push notification # Copy the latest XML feed entry to a variable$latestEmail = ($xml.feed.entry | Select-Object -First 1) <#$xml.feed.entry.author.email$xml.feed.entry.author.name$xml.feed.entry.id$xml.feed.entry.issued$xml.feed.entry.link$xml.feed.entry.modified$xml.feed.entry.summary$xml.feed.entry.title#> # Info for Gotify, if $GoToken is null then no Push is sent$GoToken = ''   # Token obtained from the Gotify server$GotifyUrl = '' # eg. http://localhost:8080/message if ($GoToken -ne '') {  $ContentType = "application/json"  $Method = "POST"  $JsonMsg = @{    message = "From: $($latestEmail.author.name), $($latestEmail.author.email)`r`nID: $($latestEmail.id)`r`nIssued: $($latestEmail.issued)`r`nLink: $($latestEmail.link)`r`nModified: $($latestEmail.modified)`r`nSummary: $($latestEmail.summary)`r`nTitle: $($latestEmail.title)";    priority=2;    title="$($model)"  } | ConvertTo-JSON  $Header = @{}  $Header.Add("X-Gotify-Key", $GoToken);  $Header.Add("accept", "application/json");  $t = Invoke-RestMethod -Method $Method -Uri $GotifyUrl -Header $Header -Body $JsonMsg -ContentType $ContentType}  # Info for Pushetta, if $Token is null then no Push is sent$Token = ''$Channel = '' if ($Token -ne '') {  $Uri ='http://api.pushetta.com/api/pushes/' + $Channel + '/'  $ContentType = "application/json"  $Method = "POST"  $JsonMsg = @{    body = "From: $($latestEmail.author.name), $($latestEmail.author.email)`r`nID: $($latestEmail.id)`r`nIssued: $($latestEmail.issued)`r`nLink: $($latestEmail.link)`r`nModified: $($latestEmail.modified)`r`nSummary: $($latestEmail.summary)`r`nTitle: $($latestEmail.title)";    message_type ="text/plain"  } | ConvertTo-JSON  $Header = @{}  $Header.Add("AUTHORIZATION", " Token $($Token)")  $t = Invoke-RestMethod -Method $Method -Uri $Uri -Header $Header -Body $JsonMsg -ContentType $ContentType}

The notification you'll end up with from the above, (I've blurred things particular to my server/email).
Gmail to SMS - (and any loud, annoying iPad notification method)

Steven Avery:
Have you taken a look at IFTTT?  And if you do decide to go that way, instead of using SMS, you might take a look at Pushbullet.  I have something like that set up where I install pushbullet on my phone, and receive the e-mail alerts for my site being down.
-wraith808 (August 22, 2019, 02:11 PM)
--- End quote ---
Let us look at IFTTT as a source for either:
1) SMS
2) Pushbullet

With the starting point being Gmail or any Server receiving mail. (e.g. Runbox, Fastmail.)

IFTTT seems to indicate that they only have two basic Gmail actions:
https://help.ifttt.com/hc/en-us/articles/360020249393-Important-update-about-the-Gmail-service
"Unfortunately, this change means that all Gmail triggers and the Create a draft action will be removed from IFTTT. The Gmail actions Send an email and Send yourself an email will remain intact."

Actually, can't Gmail accomplish the same through filters and forwarding?
(Answer..apparently IFTTT creates an on-demand action, maybe on a web-page, also it can send to 20 people, the multiple sending is a trick not easy in the Gmail filters)

At times they go back to the method that needs a smartphone, since an email received at a special carrier's email address converts to SMS.

https://ifttt.com/applets/C5LQGvaJ-let-someone-know-you-re-heading-home
. A nifty trick with this Applet: Most carriers have a way to send a text message to someone by emailing a specific email address, which you can use to send them an SMS instead of an email using this same Applet!

My goal is to receive my email on my Talkatone SMS number (which Twilio sents to properly).  I am not a big fan of smartphones, I use a clam-shell, for which the text function is rinky-dink.  I will think of getting a SmartPhone.

Do you have more information on using IFTTT in its current state?

Wait .. it would be Gmail to Pushbullet.

So let's see first if Pushbullet can be triggered by an email.

Also, note that, for simplicity, it would be fairly easy to create a special email box (Gmail, Fastmail, Runbox)  that receives redirected mail that is meant to trigger the SMS or Pushbullet or whatever.  That would provide an easy archive and check spot.

Interesting studies.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version