Sending daily message via GCM server on google app engine - google-app-engine

I am trying to perform following.
I have deployed Google App Engine Server on Google App Engine.
Created dailyMessage.html within Web-INF at WEB-INF/data/dailyMessage.html
Trying to send the content of dailyMessage.html as Payload message.
However i have to upload this data file on daily basis to send updated message everyday. Is there any other way to achieve this functionality? I tried to explore for BlobStore functionality. However i didn't get the way i can upload and replace the file and access it via HTTP URL. Any help to achieve above functionality would be appreciable.

It sounds like you're manually creating the daily message, if so create a POST handler that allows you to POST the daily message.
Otherwise, if it's automatically generated, use a cron job that generates the message and sends it.

Related

Use Cloud Pub/Sub to trigger sending of email

I'm trying to figure out how to use Cloud Pub/Sub to trigger the sending of an email when a file is added to a storage bucket.
Currently using PHP72 in Google App Engine standard environment. First I created a Topic that creates a message when a file is added to the storage bucket. Then I created a Pull subscription which reads the message. I can view the messages in the GCP console, but what I would like to happen is that I want to be notified by email, preferably with a copy of the file added to the email as an attachment. Is this possible? I tried looking for a solution or tutorial but came up empty.
You can implement the send mail login in a cloud function which will be triggered by Pub/Sub (Node.js,Python,Go).
Using Pub/Sub to trigger a Cloud Function
Instead of using a pull subscription, you should probably use a push subscription with App Engine, combined with one of the third party mail services such as Send Grid or MailJet.
The upload of an object to GCS triggers a message to be sent to the topic, and the push subscription delivers that message to App Engine.
Unfortunately, there aren't any full tutorials asking for exactly what you want, but hopefully this helps. Feel free to request a community tutorial for this by filing an issue on the GCP community toturial repo.

Is it possible to send text files as request message to Google PubSub

I am trying to store files from on Google Storage. However, I do not want my primary GAE to spend time behind it. Hence I am pushing this task onto Google PubSub which further pushes it to another GAE. I know that its possible to send encoded string via Google PubSub. Is it possible to achieve the same for text files ?

Is there a limit on how many files can be dynamically generated on Google Cloud Storage?

I have an app that uses appengine and Twilio to send voice messages.
In order to send a voice message you have to have your message content in a publicly available XML file. My app has a form that allows the user to create and post a message. Once the user posts the message, my app will dynamically create the XML file and save it to a bucket in Google Cloud Storage (GCS).
It appears that this can work up to ten times only. On the eleventh attempt, CGS does not generate and save the file. When Twilio tries to make the voice call, it just craps out with a 404 error because GCS never created the file. If I delete some of the files in my bucket, it'll start working again.
I can't find any documentation on Google regarding this kind of limitation. Does anyone know if there is such a limitation?
Thanks

Should I upload files to Amazon S3 from mobile devices or from my server?

I have Amazon S3 as my file storage server and EC2 instances as my application logic server. Now my app needs to upload some files which need necessary processing. I can think of two ways to do this:
Upload the file directly from mobile devices and get the file name and location(url), then send the url to my backend. Backend get the file by URL and do its job.
Send the file to backend using a multipart form, backend accepts the file do its job and finally save the file to Amazon S3.
Which is the standard way? What are the reasons?
Sending the object direct to Amazon S3 will be more scalable, less error-prone and cheaper (since you need less web server capacity to handle the uploads). Send the corresponding information to a Simple Queueing Service (SQS) queue that the back-end service can monitor and process. That way, if your back-end is ever offline, the jobs will simply queue-up and will get processed when the server is running again. A good use of loose coupling.
A third option would be to send the file directly from your mobile to Amazon S3, using Metadata fields to identify originating user, and then configure the S3 bucket to trigger some code in AWS Lambda that can process the file. This could do all the processing, or could simply trigger a process on your web server. Again, this reduces load on the web server and would not require sending a message to trigger the processing.

Google Cloud Send Email Upon File Upload

I'm new to Google Cloud, I'm trying to find out is there a way where everytime I upload a file to the Cloud Storage I can have an instance send an email to the user? I already have my device uploading files to Cloud Storage without any issues, however the device is also sending the emails to - and since it's an embedded application I'd prefer to off load that task.
Check out GCS Object change notifications. Its the more generic answer for "how do I take action when a file changes in GCS", but you could certainly implement a notification handler in appengine to handle your email notifications.

Resources