crypto news

Autoressbondor AI: Smart method of managing your inbox

With work and a private life that mixes more than ever, the management of the overwhelming excessive incoming box can be. But what if the responses to you can, do you just need to review you? Learn Autoressbonder AI: Email without a server on AWS who uses artificial intelligence to simplify the connection. This article will dismantle how it works and how it can make e -mails processing easier.

What is Autoressbonde AI?

Autoressbonder AI is a smart addition of Gmail that can help you manage emails and prevent excess pregnancy in the inbox. He wipes unreasonable emails, discovers feelings, drafts of drafts for those who need to respond, and provide them for your review. Once the drafts are ready, they teach you via email or SMS, which makes you updated. It is based on a safe and cost -effective system, it is ideal for busy professionals, customer service teams, or anyone who wants to stay responding to the least problem.

Why automatic stress from artificial intelligence?

  • It enhances productivity – Automation of responses to unreasonable email messages, saving time and effort.
  • Improving time management Artificial intelligence is used to determine the priorities and generate the responses of the context.
  • Security guarantees – It protects the accreditation data with the AWS Secrets Director.
  • It improves communication Vocational responses professional letter, specially designed for each recipient.

Autoresbonder AI is useful for business professionals, executives, sales teams and customer service departments because it brings AI’s automation power to the Innicated Postal Management efforts.


Step Step Directory to develop and publish Autorsboster AI

#Step 1: Gmail Gmail Oauth data from Google Console

To access the Gmail via API, you need the OATH credit data from Google Cloud Console.

  1. Create Google Cloud

    1. Open Google Cloud Console -> Select a new project -> You can call it GmailorePly or anything you choose -> Click Create.

  2. Empowering Gmail API

    1. Go to applications and services programming facades.

    2. Enable applications and services programming facades, search for and enable Gmail API.

  3. Create OATH credentials

    1. Go to applications and services programming facades -> Accreditation data -> Create accreditation data -> OATH customer identifier.

    2. Choose the type of app: desktop application and its name Lambda Gmail customer.

    3. Click Create and download client_secret_xxx.json file.

  4. Getting distinctive symbols to reach and update:

    1. Make sure you have the right Python libraries installed on your local device ::

      pip install google-auth-oauthlib google-api-python-client
      
    2. Use the following Python text program to create symbols (replace “Path/To/Client_secret.json” with the path to the downloaded JSON file):

    3. Run this Python text program to generate distinctive symbols to access and update:

      From Google_auth_OATHLIB.Flow Import Installedappflow Scopes = ['
      
      flow = InstalledAppFlow.from_client_secrets_file(
      
          'path/to/your/client_secret.json', scopes)
      
      credentials = flow.run_local_server(port=0)
      
      print(f"Access Token: {credentials.token}")
      
      print(f"Refresh Token: {credentials.refresh_token}")
      
          
      
    4. When you run the script, It will ask you to log in to your Gmail account and authorize the app in a browser window after  running the script.

    5. Copy the access_token and refresh_token for later use.

    Google Console Cloud for Lambda Gmail Client projectGoogle Console Cloud for Lambda Gmail Client project

Step 2: Store Gmail OAuth Credentials in AWS Secrets Manager

To store Gmail credentials securely, use AWS Secrets Manager. To do this, follow these steps:

  1. Go to AWS Console and select Secrets Manager.

  2. Click on Store a new secret and select Choose  Other Type of secret.

  3. Copy and paste the following key-value pairs:

    1. gmail_client_id (from client_secret.json)
    2. gmail_client_secret (from client_secret.json)
    3. access_token (from the Python script)
    4. refresh_token (from the Python script)
  4. Click Next, enter the secret  name as GmailOAuthSecrets and click on Store.

  5. Remember the Secret ARN which will be used  in Lambda.

AWS Secret Manager to Store Gmail OAuth CredentialsAWS Secret Manager to Store Gmail OAuth Credentials

Step 3: Create an SNS Topic for Notifications

To notify users when email drafts are created, set up Amazon SNS. To do this, follow these steps:

  1. Go to AWS Console and select SNS from the search bar.
  2. Choose Standard and then click Create topic.
  3. The name of the new topic is EmailDraftsCreated and click Create topic.
  4. The Topic ARN is copied for later use.
  5. Click Create Subscription, select Protocol and then select Email, and then enter your email and confirm.

AWS SNS topic for EmailDraftsCreatedAWS SNS topic for EmailDraftsCreated

Step 4:

Create an IAM Role for Lambda For Lambda to work, it requires permission to work with other AWS services.

  1. Go to AWS Console and select IAM from the search.

  2. Click on Roles and select Create role, then choose AWS Service and then Lambda.

  3. Attach the following policies:

    1. AWSLambdaBasicExecutionRole (for logging)
    2. AmazonSNSFullAccess (for notifications)
    3. SecretsManagerReadWrite (for storing Gmail credentials)
    4. AmazonComprehendFullAccess (for sentiment analysis)
    5. AmazonBedrockFullAccess (For AI generated replies)
  4. The role is named as LambdaEmailProcessor and then click create role.

LambdaEmailProcessor IAM RoleLambdaEmailProcessor IAM Role

Step 5: Prepare Amazon Amazon Bedrock for the AI Response

First check that Amazon Bedrock is turned on in us-east-1 region.

  1. Go to Amazon Bedrock in the AWS Console.

  2. In Model Access, enable Amazon Titan Text G1 – Premier or any other model you prefer.

  3. Accept the access request.

Step 6: Create and Deploy the AWS Lambda Function

This Lambda function will process emails,  analyze sentiment, generate replies, and save drafts.

  1. Navigate to AWS Console; select Lambda from search and Create Function.
  2. Choose Author from Scratch, name it “EmailAutoReplyProcessor” and select Python  3.9.
  3. Assign the IAM role “LambdaEmailProcessor”.
  4. Install required dependencies:

pip install boto3 google-auth-oauthlib google-auth-httplib2 google-api-python-client -t lambda_package/

  1. Save the Lambda  code (provided below) as lambda_package/lambda_function.py.

    import json
    import os
    import boto3
    from google.oauth2.credentials import Credentials
    from googleapiclient.discovery import build
    from google.auth.transport.requests import Request
    import base64
    import re
    from googleapiclient.errors import HttpError
    
    # AWS Clients
    secrets_manager = boto3.client('secretsmanager')
    comprehend = boto3.client('comprehend')
    bedrock = boto3.client('bedrock-runtime')
    sns = boto3.client('sns')
    
    def extract_sender_name(sender_email):
        """
        Extracts the sender's name from the email 'From' field.
        Example:
        - 'John Doe <[email protected]> '→' John Doe ' -'[email protected]'→' John '"" Match = Re.Match (R "(.[0].[email protected]'DEF LAMBDA_HANDLER['SECRET_ARN']
            Secret = Secrets_manager. steet_secret_value (Secretid = Secret['SecretString'](Creds = Accreditation Data (TOKEN = Secret_JSOSETET ('Access_token'), Refresh_token = Secret_JSON['refresh_token']Client_id = secret_json['gmail_client_id']Client_secret = Secret_JSON['gmail_client_secret']Token_uri = ') if it is CREDS.EXPIRED and Creds.refrest_token: print ("regreshed texy ...")) Creds.refresh (request ()) Secret_JSON['access_token'] = CREDS.TOKEN Secrets_manager.put_secret_value (Secretid = Secret_arn, Secretsstring = Json.dumps (Secret_JSOS) Print ("Taken Refreshed") Service.users (). Messages (). List (userid = 'me', labelids =['UNREAD']). []Print (F “Feed {LEN (messages)} unread email messages”) if the messages are not: print (“No unread email messages.['id']Format = 'Full'). Execute () Headers = {h['name']: H['value'] L h in the message['payload']['headers']} Subject = headers.Get ("Theme", "No topic") Send = Headers.GET ('From', "Unknown")['payload'].GET ('Body', {}). Get ('Data', 'Text = BASE64.URLSAFE_B64DECODE (Body_data). {Text}}) #[:5000]Languagecode = 'en') feelings = sument_response['Sentiment']
                Print (F "feelings: {Securitime})) if the feelings are in ['POSITIVE', 'NEGATIVE']: # AI is improved for Titan Model Prompt = F "" You are an Amnesty International Email Assistant to formulate a professional response to an unread email from the user. Greetings (dear_Name)) (for example, "{subject} content: --- {text[:1000]} --- ** The response of the response body: ** "" Try: # Invoke Amazon Bedrock Bedrock_response = Bedrock.invock_model (modelid = 'Amazon.titan-Text-Lite-V1', Body = Json.dumps ({" Intecttext ": Promst," Topp ": 0.9})) Reply_body = json.loads (BEDROCK_RESPONSE['body']Read ())['results'][0]['outputText'].strip () Print (F "AI replied: {Reply_body}) except for the exception E: print (f" errock error: {str (e)})) Raise # check any greeting or closing in the response of artificial intelligence [f"dear {sender_name.lower()}", f"hello {sender_name.lower()}", f"hi {sender_name.lower()}", "dear", "hello", "hi"]
                    Closing_patterns = ["best regards", "sincerely", "kind regards", "thank you", "regards"]
                    Reply_has_greeting = Any (pattern in response _Body_lower for the pattern in gene_patterns) Reply_has_closis = i. DRAFT_Message = F "To: {Sander} \ NSubject: Re: {Tource} \ n \ n {reply_body}" DRAFT = {'message': base64.urlsafe_b64Encode (DRAFT_Message.ENCODE ('UTF-8')) httperror as e: print (F "Failure to create the draft: {e}))['SNS_TOPIC_ARN']Messenger = F "{drafts_created} New email drafts have been created. Please review in Gmail. (Printing (Snow Snis)) Return {'StatusCode': 200, 'Body': F'PROCOOED {LEN (Messenger)}, created {Praphs_created}} with the exception of httperror as a mistake: print (f "gmail API Error: {Error} “) {Error}} except for the exception, such as e: print (f” error: {str (e)} ”) Return {'StatusCode': 500, 'Body': F'an Error event: {Str (E)}}}
    
  2. Publication of the code:

    1. Lambda_Package folder:

      cd lambda_package
      zip -r ../lambda_function.zip .
      
    2. In the LAMBDA control unit, select the code tab, click download from the .zip file, and download Lambda_function.zip.

  3. Environmental variables:

    1. Go to the configuration; Select the environment variables and click Edit.

    2. Add the following values:
      Secret_ARN: ARN Director (Step 2)

      SNS_TOPIC_ARN: Your SNS theme ARN (Step 3)

    3. Click the Save button.

  4. Appointment of the deadline:
    Under the composition, select the general configuration and click the “Edit” button, then set the deadline to 5 minutes to accommodate the processing of multiple emails.

Emailutoreplyprousssor lambdaEmailutoreplyprousssor lambda

Step 7: Learn to implement the workflow automation using Amazon Eventbridge

  1. Go to the AWS console and select Eventbridge and create the base.
  2. His name is Gmail-UAUTOREPLY-SHEDULE.
  3. To express the schedule, mode: average (2 hours)
  4. For goals, choose the Lambda function and select Emailoreplyprocess.
  5. Click Create a base.

Amazon Eventbridge for Gmail-Autoreply-ScheduleAmazon Eventbridge for Gmail-Autoreply-Schedule

Step 8: Review and send emails in Gmail

Review the final outputs of Autoresponder AI in your Gmail account at the end of the process.

  • Log in to your Gmail account.
  • Go to the draft folder.
  • Read through both drafts created from artificial intelligence, make any necessary changes, then send each of them manually when finished.

Unread email in your inboxUnread email in your inbox

Autoressbondind ai created a draftAutoressbondind ai created a draft

An e -mail created from artificial intelligence has been created An e -mail created from artificial intelligence has been created

I did not build it

These steps were verified and have successfully created Autorsboster AI, an artificial intelligence -based email:

  • Check your inbox in Gmail, every two hours of new non -readable messages.
  • Amazon uses an understanding to determine these emails.
  • To free emails that need your attention, it is a professional responsibility with the help of the Amazon foundation.
  • It also organizes drafts for you in Gmail.
  • He teaches you through Amazon SNS when there are new drafts.

This is a safe, cost -effective solution and full customization. Get a better and more efficient way to work with emails with Autorsboster AI!

Enjoy!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker