/mail amir.gholzam@live.com | Send email from Slack using OpenFaaS |
This is working Yeahhhh 👍
version: 1.0 | |
provider: | |
name: openfaas | |
gateway: http://127.0.0.1:31112 | |
functions: | |
contactus-fn: | |
lang: node12 | |
handler: ./contactus-fn | |
image: contactus-fn:latest | |
labels: |
'use strict' | |
const fs = require('fs') | |
const nodemailer = require('nodemailer') | |
const formidable = require('formidable') | |
const fetch = require('node-fetch'); | |
const secretKey = fs.readFileSync('/var/openfaas/secrets/secret-key', 'utf8'); | |
const gmailEmail = fs.readFileSync('/var/openfaas/secrets/gmail', 'utf8'); | |
const gmailPassword = fs.readFileSync('/var/openfaas/secrets/gmail-pass', 'utf8'); |
version: 1.0 | |
provider: | |
name: openfaas | |
gateway: http://127.0.0.1:31112 | |
functions: | |
contactus-fn: | |
lang: node12 | |
handler: ./contactus-fn | |
image: contactus-fn:latest | |
labels: |
'use strict' | |
const fs = require('fs') | |
const nodemailer = require('nodemailer') | |
const formidable = require('formidable') | |
const gmailEmail = fs.readFileSync('/var/openfaas/secrets/gmail', 'utf8'); | |
const gmailPassword = fs.readFileSync('/var/openfaas/secrets/gmail-pass', 'utf8'); | |
const mailTransport = nodemailer.createTransport({ | |
service: 'gmail', |
version: 1.0 | |
provider: | |
name: openfaas | |
gateway: http://127.0.0.1:31112 | |
functions: | |
contactus-fn: | |
lang: node12 | |
handler: ./contactus-fn | |
image: contactus-fn:latest | |
labels: |
// | |
// Adpated from https://github.com/openfaas/openfaas-cloud/blob/master/dashboard/of-cloud-dashboard/handler.js | |
// Copyright (c) 2016-2019 Alex Ellis | |
// Copyright (c) 2018-2019 OpenFaaS Author(s) | |
// | |
'use strict' | |
const fs = require('fs') | |
module.exports = async (event, context) => { | |
const { method, path, query } = event; |
'use strict' | |
const fs = require('fs') | |
const nodemailer = require('nodemailer') | |
const fetch = require('node-fetch'); | |
const formidable = require('formidable') | |
const secretKey = fs.readFileSync('/var/openfaas/secrets/secret-key', 'utf8'); | |
const gmailEmail = fs.readFileSync('/var/openfaas/secrets/gmail', 'utf8'); | |
const gmailPassword = fs.readFileSync('/var/openfaas/secrets/gmail-pass', 'utf8'); |
"use strict" | |
const fs = require("fs") | |
const nodemailer = require('nodemailer'); | |
const md = require('markdown-it')({ | |
html: true, | |
linkify: true, | |
breaks: true, | |
typographer: true | |
}); | |
const emoji = require('markdown-it-emoji'); |
cd $HOME/mail-of-slack | |
curl -O https://raw.githubusercontent.com/openfaas/cloud-functions/master/pub-cert.pem |
/mail amir.gholzam@live.com | Send email from Slack using OpenFaaS |
This is working Yeahhhh 👍