Estoy tratando de crear una notificación de texto SMS que envíe correos electrónicos importantes al teléfono de una persona como texto y muestre ese mensaje de correo electrónico como texto. Esto es lo que tengo pero el problema que tengo es:
Adjuntaré el código a continuación, cualquier ayuda sería apreciada.
function onGmailMessage(e) { console.log(e); // Get the ID of the message the user has open. var messageId = e.gmail.messageId; // Get an access token scoped to the current message and use it for GmailApp // calls. var accessToken = e.gmail.accessToken; GmailApp.setCurrentMessageAccessToken(accessToken); // Get the subject of the email. var message = GmailApp.getMessageById(messageId); var subject = message.getThread().getFirstMessageSubject(); // Remove labels and prefixes. subject = subject .replace(/^([rR][eE]|[fF][wW][dD])\:\s*/, '') .replace(/^\[.*?\]\s*/, ''); // If neccessary, truncate the subject to fit in the image. subject = truncate(subject); return createCatCard(subject); } function onGmailCompose(e) { console.log(e); var header = CardService.newCardHeader() .setTitle('Gmail SMS Alerts') // Create text input for entering the phone number. var input = CardService.newTextInput() .setFieldName('text') .setTitle('Enter Your Number') var action = CardService.newAction() .setFunctionName('onGmailInsertCat'); var button = CardService.newTextButton() .setText('Send confirmation SMS') .setOnClickAction(action) .setTextButtonStyle(CardService.TextButtonStyle.FILLED); var buttonSet = CardService.newButtonSet() .addButton(button); // Assemble the widgets and return the card. var section = CardService.newCardSection() .addWidget(input) .addWidget(buttonSet); var card = CardService.newCardBuilder() .setHeader(header) .addSection(section); return card.build(); }