Node posts

Twilio Verify is an easy to use service for user verification. This service now includes support for WhatsApp one-time passcodes (in public beta, as of June 2022). In this tutorial you’ll learn how to implement a WhatsApp user verification flow in a JavaScript application, using Node.js and Express.
Requirements
To work on this tutorial you will need the following items:
- Node.js installed on your machine.
- A Twilio account. If you are new to Twilio click here to create a free account now and receive $10 credit when you upgrade to a paid account. You can review the features and limitations of a free Twilio account.
- An active WhatsApp account, to test the project.
Create a Twilio Verify service
To use Twilio Verify in an application, a Verify service must be created first. Open the Twilio Console in your web browser, type verify in the navigation bar’s search box, …

When it comes to messaging applications, read receipts are a common feature that allow you to know if your recipient has read your message. For email applications, this feature is very uncommon; however, when sending marketing and especially important emails, it's sometimes vital to know and keep track of whether your recipients have opened and read your email.
When using Twilio SendGrid, keeping track of email engagement is seamless through Event Webhooks. Event Webhooks not only track the delivery status of your emails but also engagement events such as if an email has been opened or a link within an email has been clicked. Pairing open and click tracking for emails with Twilio’s Programmable SMS API will ensure you’re up to date on the status of your important emails.
In this tutorial you’ll learn how to track and send SMS alerts for open and click events for your …

This post covers how to add custom attributes (AKA metadata) to an SMS message. This allows your team to receive data on SMS campaigns sent to your customers, log activity, and more! The examples below are written using Twilio’s Node.js helper library.
Custom attributes provide a system to categorize various digital marketing and feature campaigns. If you want to get fancy with personalization, metadata can also track variants within a single test. Even with the absence of a formal metadata parameter on the programmable SMS endpoint, we can still add attributes for campaign managers to track customer analytics. And, really, someone’s boss asked for a consumer trends report for the third time.
Basically, tech experts want to learn what features work and what features flop. If you run digital campaigns through SMS or Voice (or were the lucky recipient of the Jira task to add this feature), you’re …

この記事はPhil Nashがこちらで公開した記事(英語)を日本語化したものです。
Webサイトにメールアドレスを公開すると、スクレーピングされ、スパムに使用されるおそれがあります。この問題を回避し、同時に自身のWebサイトからメールで問い合わせを受け取れるようにする方法の一つとして、問い合わせフォームを構築することがあります。
本稿では、Twilio SendGridベースの開発プロジェクトの一例として、ウェブサイト上で問い合わせフォームを構築し、メールアドレスを公開することなく問い合わせのメールを受け取れるようにする方法を説明します。
プロジェクトはTwilio Functionsも使って構築しますが、本稿でご紹介するコードはあらゆるNode.js環境での使用に対応しています。
APIによるメール送信との違い
ユーザーがお問合せフォームを送信した際は、お問合せフォームを入力した人のメールアドレスを送信元とするメールがウェブサイト運営者に送信されることがよくあります。しかし、メール送信に関する信頼性を維持するため、Twilio SendGridは単一送信元として検証されたアドレス、または認証済みのドメインからの送信しか許可しません。
そのため、提供されたメールアドレスをfrom
アドレスとして使用する代わりに、reply-to
アドレスに設定できます。この方法であれば、Twilio SendGridは認証済みメールアドレスからメールを送信する一方で、受信 …

この記事はDhruv Patelがこちらで公開した記事(英語)を日本語化したものです。
はじめに
一日中端末に向かい、商品の値下げを待つのは面倒な作業です。メール通知システムなら、一番欲しい商品を逃すことはありません。お探しのものが話題の靴であれ、リビングルームのソファーであれ、すべて自動化することで、テクノロジーをご自身のために活用いただけます。
本稿では、メールによる価格通知システムを構築する方法を学びます。Sneaks APIを使用してスニーカーの価格を追跡し、特定のスニーカーの価格が下がるとTwilio SendGridのメールアラートを配信するシステムです。
必要条件
本稿の内容を理解いただくために、以下が必要となります。
- Node.jsのインストール
- 無料のTwilio SendGridアカウント
- この開発プロジェクトをテストするためのメールアドレス
環境設定を行う
このセクションでは、まずTwilio SendGridアカウントを設定し、メール通知システムのベースを構築することで、環境設定を行います。
Twilio SendGridのAPIキーを作成
まず、Twilio SendGridのアカウントにログインし、管理コンソールの [API Keys] 画面に移動します。右上の [Create API Key](APIキーを作成)ボタンをクリックします。
APIキーの名前を指定し、[Create & View](作成と表示)ボ …

この記事はDhruv Patelがこちらで公開した記事(英語)を日本語化したものです。
アプリケーション開発におけるメールサービスに関して言えば、Twilio SendGridなどのクラウド側でホストされているメールAPIを使用し、ニーズに合わせて設定をカスタマイズするとよいでしょう。ただし、既存のプラットフォームでSMTP(Simple Mail Transfer Protocol)がすでに有効な場合は、広く普及しているメール標準であるSMTP経由でメールを送信する方法を採用したい場合もあるでしょう。幸いなことに、Twilio SendGridではSMTPリレーサービスを提供していますので、自前のサーバーをセットアップする必要はありません。また、これまでどおり、詳細なメトリクス、分析のトラッキング、優れた配信率の恩恵を受けることができ、X-SMTPAPIヘッダーを介してSendGridの多くの機能も利用できます。
このチュートリアルでは、Node.jsとTwilio SendGridのSMTPリレーを使ってメールを送信する方法について説明します。

When it comes to email services in application development, a hosted email API – such as Twilio SendGrid – is the way to go as it offers ways to customize the setup to your needs. However, you may want to send emails through SMTP (Simple Mail Transfer Protocol) if it is already on your existing platform and since it is an email standard that's used universally. Luckily, Twilio SendGrid offers an SMTP Relay service without having to set up your own server. You’ll also still have access to in-depth metrics, analytics tracking, increased deliverability rates and even more SendGrid features through the X-SMTPAPI header.
In this tutorial, you’ll learn how to send out emails through Twilio SendGrid’s SMTP Relay in Node.js.
If you have the option and are still deciding whether to integrate SendGrid through our API or SMTP Relay, we highly recommend using our Web API. SMTP …

In this article you are going to learn how to build a basic video conferencing solution using Twilio Video. The system is going to run on desktop and mobile web browsers, so participants will not need to download or install any software on their computers to join a call.
The application will be coded in JavaScript, with some HTML and CSS. It will be deployed to the Twilio Serverless platform, so that you can use it to connect with family, friends or colleagues anywhere in the world without having to worry about complicated hosting solutions.
Do you want to see what you’ll build before you start? Here is a screenshot.
By following this article, you can learn how to create this project in small incremental steps. If you prefer to download the complete project instead of building it step-by-step, you can find the code in this GitHub repository: https://github.com/miguelgrinberg/twilio-serverless-video …

Introduction
There is so much going on around the globe every day, sometimes, it’s hard to keep up with it all. As life gets busier and busier, you are left with very little in the daytime to read the news. What if you could have the latest news sent to your inbox every day?
In this article, you will learn how to automate and receive daily news updates in Node.js using Twilio SendGrid and News API .
Prerequisites
Before proceeding, you will need the following:
- Node.js installed on your machine.
- A News API account to get the API Key.
- A free SendGrid account to receive emails.
- A code editor - For this tutorial, I’ll be using Visual Studio Code but you are free to use any editor of your choice.
Configure the Environment
Before you begin writing code, you must first prepare the environment to meet the needs of your …

With just a few lines of code, you can simply run a Node.js application straight from the terminal and use Twilio to send and receive text messages with Twilio Programmable SMS.
The basics of environment variables in Node.js
Node.js is one of the most talked about frameworks in the web development community since Rails. While still very young, Node.js has shown itself to be fast, highly-scalable, and efficient. The reason for this is due to its event-driven, nonblocking input/output structure.
Combining it with Twilio makes building awesome telephony apps really easy. So if you wanted to send an SMS, for example, you’ll need to install Node.js and the Twilio Node.js module.
Another great feature of the Node.js language (and its modules) is that it has a neat way of working with environment variables, which many cloud hosts (such as Heroku, Azure, AWS, Now.sh, etc.) use. This opens up an …