PHPackages                             tokens/email-sms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tokens/email-sms

ActiveLibrary

tokens/email-sms
================

Validate emails with tokens and PortaText SMS

v1.0(10y ago)07Apache-2.0PHPPHP &gt;= 5.3.0

Since May 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/diegonalvarez/token-sms-emails)[ Packagist](https://packagist.org/packages/tokens/email-sms)[ RSS](/packages/tokens-email-sms/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (0)

Synopsis
--------

[](#synopsis)

This project allows to you get a two factor validation for different purposes. Is a way to enforce your security website sending two tokens for differentes channels but they need to match in your bussiness logic. The channels are email and sms.

Requirements
------------

[](#requirements)

To use this tool is necessary have an account in the providers for SMS and EMAILS. In this package we have available two clients to use that are:

- [www.portatext.com](http://www.portatext.com)
- [www.sendgrid.com](http://www.sendgrid.com)

Be sure to have your accounts and get your API-KEYS-ID. Otherwise if you can't use this providers, you can extends the package creating a class for each new client that you need.

Code Example
------------

[](#code-example)

Is very simple use this package, with the correct configuration, the only thing you need to do in your app is create an instance of TokenEmailSms::

```
$tokenEmailSms = new TokenEmailSms;
```

Then is necessary set the variables of our recipients:

```
$tokenEmailSms->setAddress('test@test.com', '123456789');
```

And the next thing you need to do is only send the tokens to the two channels:

```
$tokenEmailSms->send();
```

Now it depends on your bussiness rules but something common to do is get the two generated tokens and saved in your database to do whatever you need to do, this is the place where you are creative and validate in this point that the tokens works together:

```
$tokenEmailSms->tokenSms():
$tokenEmailSms->tokenEmail():
```

If you set this two tokents with an id and status in your database, when the user enter the two tokens you will validated and if not match, something is wrong.

Motivation
----------

[](#motivation)

I wrote this package because i need to found an extra secure way to validate some distracted users. They can lose his phone or may be the password email, but in exceptional cases the same person will find both channels together. It's not extra safe, but it try to be more closer to reality.

Installation
------------

[](#installation)

To install this project is necessary do the following steps:

#### 1 - Composer update

[](#1---composer-update)

Run composer update to install the libraries.

```
composer.phar update
```

#### 2 - Set the config file.

[](#2---set-the-config-file)

A file called `token-email-sms-config-example.php` is provided. You need to set your own file and called `token-email-sms-config.php` and set your own credentiales to get TokenEmailSms works. The file is very well described so the only thing you need to do is change the variables from the arrays 'email' and 'sms'.

Tests
-----

[](#tests)

Once you have the installation finish and correct setting you can run the tests with:

```
vendor/bin/phing test

```

Contributors
------------

[](#contributors)

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

License
-------

[](#license)

The source code is released under Apache 2 License.

Check [LICENSE](https://github.com/PortaText/php-sdk/blob/master/LICENSE) file for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3659d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9ce44d89dffe39c7afeee542c2ad32d07a7f06ef98c4db8517c327eaca5f11e?d=identicon)[diegonalvarez](/maintainers/diegonalvarez)

---

Top Contributors

[![diegonalvarez](https://avatars.githubusercontent.com/u/4616551?v=4)](https://github.com/diegonalvarez "diegonalvarez (4 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tokens-email-sms/health.svg)

```
[![Health](https://phpackages.com/badges/tokens-email-sms/health.svg)](https://phpackages.com/packages/tokens-email-sms)
```

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k3](/packages/elgg-elgg)[neos/flow

Flow Application Framework

862.0M449](/packages/neos-flow)[api-platform/metadata

API Resource-oriented metadata attributes and factories

223.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[flowwow/cloudpayments-php-client

cloudpayments api client

2188.2k](/packages/flowwow-cloudpayments-php-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
