I wrote a function that receive a http request and send a e-mail. But, I would like receive a http request and send a pub message. The problem is that the documentation is not clear. How I do that?
This is my actual code.
exports.weeklyEmail = functions.https.onRequest((req,res) => {
const email = '****@gmail.com'
console.log('Sending e-mail')
const mailOptions = {
to: email,
from: '****@alunos.utfpr.edu.br',
subject: 'Teste',
text: 'Conteudo do email '
}
mailTransport.sendMail(mailOptions).then(
() => {
res.send('Email sent')
}
).catch(error => {
res.send(error)
})
})