Method

extractEmails — Extracts email addresses from a text.

Description

This method is used to extract email addresses from a given text. If one or more email addresses are found inside a text it will extract a collection of email addresses.

Minimum number of arguments for this method is one.

Structure of the method:

extractEmails(text)

Parameters

text— this is the text that will be checked for containing emails inside it.

Examples

In the example below, we will show all the extractEmails fetches a collection of emails from a text.

//Fetch email addresses from a text

{% set text = 'Flexie CRM has two main email addresses for support, support@flexie.io and help@flexie.io. You can reach both addresses in case you need support.' %}

{% set emailList = extractEmails(text) %}

{% for email in emailList%}
{{email}}
{% endfor %}

//Output:

// support@flexie.io
// help@flexie.io

To stay updated with the latest features, news and how-to articles and videos, please join our group on Facebook, Flexie CRM Academy and subscribe to our YouTube channel Flexie CRM.