GithubHelp home page GithubHelp logo

rcarrascosps / fn-email-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abhirockzz/fn-email-app

0.0 1.0 0.0 9 KB

Function to send emails using Oracle Cloud Infrastructure Email Delivery

Go 100.00%

fn-email-app's Introduction

Function to send emails using Oracle Cloud Infrastructure Email Delivery

Function to send emails with Oracle Cloud Infrastructure Email Delivery. It just uses the plain old SMTP package in Go

Pre-requisites

Configure OCI Email Delivery

Clone this repo

Switch to correct context

  • fn use context <your context name>
  • Check using fn ls apps

Create app

fn create app --annotation oracle.com/oci/subnetIds=<SUBNETS> --config OCI_EMAIL_DELIVERY_USER_OCID=<OCI_EMAIL_DELIVERY_USER_OCID> --config OCI_EMAIL_DELIVERY_USER_PASSWORD=<OCI_EMAIL_DELIVERY_USER_PASSWORD> --config REGION=<REGION> --config OCI_EMAIL_DELIVERY_SMTP_SERVER=<OCI_EMAIL_DELIVERY_SMTP_SERVER> --config OCI_EMAIL_DELIVERY_APPROVED_SENDER=<OCI_EMAIL_DELIVERY_APPROVED_SENDER> fn-email-app

e.g.

fn create app --annotation oracle.com/oci/subnetIds='["ocid1.subnet.oc1.phx.aaaaaaaaghmsma7mpqhqdhbgnby25u2zo4wqlrrcskvu7jg56dryxt3hgvkz"]' --config OCI_EMAIL_DELIVERY_USER_OCID=ocid1.user.oc1..aaaaaaaa4seqx6jeyma46ldy4cbuv42q4l26scz5p4rkz3rauuoioo42qwmq@ocid1.tenancy.oc1..aaaaaaaaydrjm77otncda2xn7qtv7l3hqnd3zxn2u6siwdhniibwfv4wwhta.3n.com --config OCI_EMAIL_DELIVERY_USER_PASSWORD='s3cr3t:-)' --config OCI_EMAIL_DELIVERY_SMTP_SERVER=smtp.us-phoenix-1.oraclecloud.com --config [email protected] fn-email-app

Check

fn inspect app fn-email-app

Moving on...

Deploy the app...

cd fn-email-app and fn -v deploy --app fn-email-app

Test it out

change the email contents as per your requirements (don't forget to provide a valid email address)

echo -n '{"To": "[email protected]", "Subject": "Hello from Fn", "Body": "Have fun with Fn at fnproject.io"}' | fn invoke fn-email-app sendemail

If all goes well, you should see the email (don't forget to check your spam folder) and a response from the function - Sent email successfully!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.