UCONN

UCONN
UCONN

Sunday, July 11, 2021

Requirement # 2, 7/11/2021, 9:21 PM, English, 7/11/2021, 9:21 PM

Your assigned language is: English
Classroom blog: googleclouduconn.blogspot.com

7/11/2021, 9:21 PM

Requirement number 2
The critical to path (most important functionality) is the ability to
send communications.
It is important to achieve a level of success with this functionality
and build from that point.
A simpler version of requirement 2 can use text box and send button
and only focus on email.

Looping thru all records in the table

Email: john.iacovacci1@gmail.com
Language: es
You can leverage the code from the CRUD translate example

from flask import Flask, request, render_template, redirect, send_from_directory

from google.cloud import translate_v2 as translate
translate_client = translate.Client()
# Imports the Google Cloud client library
from google.cloud import datastore

Text box would be tinst

tinst = customer['instructions']
tlang = language field from datastore table
result = translate_client.translate(tinst, target_language=tlang)
Can get all records and put in array or develop routine to read thru all records

Need to use GMAIL API

https://developers.google.com/gmail/api/quickstart/python
Remember share project with team.

Do you best to try to get this process running.

It will require establishing oauth credentials
User Authentication with OAuth 2.0
The OAuth 2.0 specification defines a delegation protocol that is
useful for conveying authorization decisions across a network of
web-enabled applications and APIs. OAuth is used in a wide variety of
applications, including providing mechanisms for user authentication.




Communication process system
Build an app engine process to input the following fields into an HTML form

Textbox
Class
Send-button
Verification (are you sure?)
date of event
Attachment

When the send button is hit

Loop thru table to find client records that match class
If record is matched check the language field to see if it needs translation'
If language is not english
Send language and text to translate API
Check to see if delivery text or email
If text send translated (if needed) textbox to number on record
If email send translated (if needed) textbox to email on record
https://uconnstamfordslp.blogspot.com/p/app-engine-flask-html-form.html
(not complete)
Please note texting may require additional work then emailing.
For better success separate out both with small POC programs.

No comments:

Post a Comment

Disable Billing

Search for Billing Manage billing accounts Go to MYPROJECTS CLICK ON THE 3 BUTTON Actions Then hit disable