backend/api/timerRouter.js
// notify contact that user has successfully completed their event
notify contact that user has successfully completed their event
notify contact that user has successfully completed their event
function eventEndSMS(user) {
  if (accountSid === "not authorized" || authToken === "not authorized") {
    console.log("contactSMS fire attempt--twilio not authorized");
  } else {
    let contact = user.contacts[0];
    client.messages
      .create({
        body: `${contact.name}, ${
          user.username
        } has successfully finished their ${
          user.events.name
        } adventure! Thanks for being there for them, JustNcase! :)`,
        from: twilioPhone,
        to: contactPhone
      })
      .then(message => {
        console.log(message.sid);
      })
      .done();
  }
}
function eventEndSMS ( user ) { if ( accountSid === "not authorized" || authToken === "not authorized" ) { console . log ( "contactSMS fire attempt--twilio not authorized" ) ; } else { let contact = user . contacts [ 0 ] ; client . messages . create ( { body : ` ${ contact . name } ${ user . username } ${ user . events . name } ` , from : twilioPhone , to : contactPhone } ) . then ( message => { console . log ( message . sid ) ; } ) . done ( ) ; } }
notify contact that user has successfully completed their event
notify contact that user has successfully completed their event