Extracting links from SMS and email
Learn how to test hyperlinks found in SMS and email messages with SMSByrd.
Before you begin
The examples shown below are based on two key assumptions:
- That you have already create a basic automated test using our getting started guides.
- You have a chosen assertion library that you will use to test the values shown below.
Links within email HTML content
When an email is sent with an HTML body, SMSByrd automatically extracts any hyperlinks found within anchor and area elements and makes these available via the html.links array.
Each link has a text property, representing the display text of the hyperlink within the body, and an href property containing the target URL.
Note that only links that have been correctly marked up in HTML will be detected.
//code snippet
Links within SMS and email text content
As with links found within the HTML content of an email, SMSByrd also detects and extracts links found within the plain text of a message (both SMS and email).
These are made available viable via the text.links array.
Each link has an href property containing the target URL. Whilst each link also has a text property, this will always have the same value as href.
//code snippet