GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-docs-samples/appengine-java8/sendgrid/README.md at master · icodevn/java-docs-samples

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
58 lines (41 loc) · 2.12 KB
/

README.md

Copy path

File metadata and controls

58 lines (41 loc) · 2.12 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Java SendGrid Email Sample for Google App Engine Standard Environment

Open in Cloud Shell

This sample demonstrates how to use SendGrid on Google App Engine standard environment.

See the sample application documentaion for more detailed instructions.

For more information about SendGrid, see their documentation.

Setup

Before you can run or deploy the sample, you will need to do the following:

  1. Sign up with SendGrid via the GCP Console and as a Google Cloud Platform developer, you can start with 12,000 free emails per month.

  2. Create an API key in SendGrid and configure your SendGrid settings in the environment variables section in appengine-web.xml.

    <env-variables>
      <env-var name="SENDGRID_API_KEY" value="YOUR-SENDGRID-API-KEY" />
      <env-var name="SENDGRID_SENDER" value="YOUR-SENDGRID-SENDER" />
    </env-variables>

Running locally

You can run the application locally and send emails from your local machine. You will need to set environment variables before starting your application:

export SENDGRID_API_KEY=[your-sendgrid-api-key]
export SENDGRID_SENDER=[your-sendgrid-sender-email-address]
mvn clean jetty:run

To send an email, visit localhost:8080/send/email?to=[EMAIL-ADDRESS] in a web browser.

Deploy

Deploy your application to App Engine standard with the following command:

mvn appengine:deploy

To send an email, visit https://[YOUR-PROJECT-ID].appspot.com/send/email?to=[EMAIL-ADDRESS] in a web browser.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.