Posts tagged with javascript

The Script I'm trying to set up uses the MailApp service to send emails to recipients included in a Ghseet.

function sendProcessingEmail() {   var customerId = AdsApp.currentAccount().getCustomerId();   if (config.emailEachRun && config.emailRecipients &&       config.emailRecipients.length) {     MailApp.sendEmail(         config.emailRecipients.join(','),         customerId + ': Link Checker: Checking is ongoing',         'Link checking is still running on account: ' + customerId +             '. For more details see the spreadsheet: ' +             CONFIG_SPREADSHEET_URL);     setDateAsNow('dateEmailed'); 

I have noticed that the Script works fine for emails made out of a combination of numbers and letters but fails to send an email when the address contains other characters. Was wondering if anyone knows a workaround for this? Many thanks in advance.

When creating a code snippets in Google Ads to track conversions on a landing page, I found that all the Functions have the same name: gtag_report_conversion(url)

Since I have 2-4 of these functions per page, I want to rename each function so that all two to four links don't call the same function.

This is the original code output from Google Ads for two links (I put xxxxx where my account number is located):

<script> function gtag_report_conversion(url) {   var callback = function () {     if (typeof(url) != 'undefined') {       window.location = url;     }   };   gtag('event', 'conversion', {       'send_to': 'AW-xxxxxxxx/v__WCOP96KwBEMGY46ID',       'event_callback': callback   });   return false; } </script> 
<script> function gtag_report_conversion(url) {   var callback = function () {     if (typeof(url) != 'undefined') {       window.location = url;     }   };   gtag('event', 'conversion', {       'send_to': 'AW-xxxxxxxx/q5SwCMKl9KwBEMGY46ID',       'event_callback': callback   });   return false; } </script> 

Can I rename each function with an _a and _b so that my link calls them like this?

<a href="link" onclick="gtag_report_conversion_a();">Link ONE</a>

<a href="link" onclick="gtag_report_conversion_b();">Link TWO</a>

Each function has a unique number after my account number, so I want to make sure the reports are accurate.

Google recently changed to this new format, so there is limited information on changing the function names nowadays -- thank you for any help anyone can provide!

I am building a Node.js application that receives messages from WhatsApp via Twilio. Sending text messages is not a problem, but when I try to send the current location from the users WhatsApp account I cannot find the coordinates in the request object sent to the server.

This is what I am doing to see what is being sent to the app from Twilio.

app.post('/incoming', (req, res) => { var incomingMessage = req.body.Body; console.log(incomingMessage); }); 

When I share my current location with the app, the request body is empty.

Can anyone shed any light on this or explain how WhatsApp shares a users location within the app?

Thanks.

When you begin your business using Twillio for sms verification is pretty expensive, I was looking for a free/very cheap service for the beginning.

I can see that Facebook provides - Whatsapp business API and it's unclear if you can already use it to send messages as an individual developer. https://developers.facebook.com/docs/whatsapp/

I can see that Twillio also have a Whatsapp API which costs money.

Is there a way to send Whatsapp messages today ?

Is there other affordable choice to verify new users by sms ?