Twilio Inc. is buying customer data infrastructure company Segment Inc. for about $3.2 billion in stock, after a boom in demand for online communications tools.

Cloud-computing company Twilio has benefited during the pandemic as customers, such as retailers and health care providers, have increasingly relied on online software to sell and communicate to customers. San Francisco startup Segment helps companies manage the streams of data they collect about their customers. It was valued at $1.5 billion in its last private funding round.

The transaction will help spur growth with a combined total addressable market of $79 billion, Twilio said in a statement. Twilio shares rose 7% in premarket trading to $327. Its stock has tripled this year, and the company is now valued at $45.6 billion.

The transaction is expected to close during the fourth quarter. Morgan Stanley & Co. is serving as financial adviser to Twilio and Cooley LLP as legal adviser. Qatalyst Partners is serving as exclusive financial adviser to Segment and Goodwin Procter LLP as legal adviser.