You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not really an issue but just an idea/enhancement. We have been using VictorOps for on-call for a few months and only a select few IT admins have access to Twilio. Callers shouldn't go to voicemail often but if and when it does, the transcription isn't great (global office, callers from multiple countries, accents involved). So, our on-call folks want access to the voicemail so they can listen to what the issue is. I tried going through support but didn't get very far with VictorOps or Twilio (not my first choice for on-call products). One suggested this: https://www.twilio.com/blog/forward-voicemail-recordings-to-email
So, I've tried to add this code (I'm not a programmer/scripter by any means and I certainly don't know JavaScript). It seems to work but sends 2 emails. Do I have the right idea here? Should this be broken out into it's own function?
//Continuation of leaveAMessage function. Email code starts at Attempt to email voicemail comment
twiml.record(
{
transcribe: true,
transcribeCallback: generateCallbackURI(
context,
{
callerId,
detailedLog,
goToVM,
runFunction: 'postToVictorOps',
teamsArray
}
),
timeout: 10,
action: generateCallbackURI(
context,
{
callerId,
detailedLog,
runFunction: 'leaveAMessage',
sayGoodbye: true,
teamsArray
}
)
}
);
}
//Attempt to email voicemail
//Initialize SendGrid Mail Client
// put this above?
const sgMail = require('@sendgrid/mail');
// Define Handler function required for all Twilio Functions (possibly not required since already within function)
//exports.handler = function(context, event, callback) {
// Build SG mail request
sgMail.setApiKey(context.SENDGRID_API_SECRET);
// Define message params
const msg = {
to: context.TO_EMAIL_ADDRESS,
from: context.FROM_EMAIL_ADDRESS,
text: `New VictorOps Voicemail from: ${event.From}\n Transcription is: ${event.TranscriptionText}\n Recording URL is: ${event.RecordingUrl}`,
subject: `New VictorOps Voicemail from: ${event.From}`,
};
// Send message
sgMail.send(msg)
.then(response => {
console.log("Recording Emailed.")
callback();
})
.catch(err => {
console.log("Error, Recording not emailed.")
callback(err);
});
resolve(twiml);
});
}
The text was updated successfully, but these errors were encountered:
Not really an issue but just an idea/enhancement. We have been using VictorOps for on-call for a few months and only a select few IT admins have access to Twilio. Callers shouldn't go to voicemail often but if and when it does, the transcription isn't great (global office, callers from multiple countries, accents involved). So, our on-call folks want access to the voicemail so they can listen to what the issue is. I tried going through support but didn't get very far with VictorOps or Twilio (not my first choice for on-call products). One suggested this: https://www.twilio.com/blog/forward-voicemail-recordings-to-email
So, I've tried to add this code (I'm not a programmer/scripter by any means and I certainly don't know JavaScript). It seems to work but sends 2 emails. Do I have the right idea here? Should this be broken out into it's own function?
The text was updated successfully, but these errors were encountered: