PHPackages                             joe-pritchard/email-countdown-timer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. joe-pritchard/email-countdown-timer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joe-pritchard/email-countdown-timer
===================================

Animated countdown timer for use within emails

15PHP

Since Jul 18Pushed 6y agoCompare

[ Source](https://github.com/joe-pritchard/email-countdown-timer)[ Packagist](https://packagist.org/packages/joe-pritchard/email-countdown-timer)[ RSS](/packages/joe-pritchard-email-countdown-timer/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Email Countdown Timer
=====================

[](#email-countdown-timer)

> Create an animated countdown timer for use within HTML emails

This is a fork of , modified to work with composer and be a little less opinionated about how its used (it just spits out the gif as a string for you to do with as you please).

It also adds the option to pass in a background image to use behind the countdown instead of a solid colour.

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

[](#installation)

`composer require joe-pritchard/email-countdown-timer`

Usage
-----

[](#usage)

- Generate a GIF countdown timer using the CountdownTimer class:

```
$gif = new CountdownTimer($settings, $target);
$gif->getAnimation(); // this is the raw gif as a string

```

Settings
--------

[](#settings)

Use the following keys in the settings array to modify the countdown timer to fit your needs.

- width (int)
- height (int)
- boxColor (hex colour)
- font (string)
- fontColor (hex colour)
- fontSize (int)
- labelOffsets (float\[\]) eg 0.5,3,5.4,7.6 - each number is applied one of the labels (Days, Hrs, Mins, Secs) respectively and is used as a multiplier on the width of a single character to push the label to the right (for example, 0.5 moves the label to the right relative to xOffset by the half width of a character in the time)

The second argument is a DateTime object representing a time in the future to count down to.

The third argument is optional, and is the absolute path to a background image to use instead of a coloured box. If a background image is provided, then the width, height, and boxColor values will be ignored New sizes will be calculated based on the size of the image.

Example
-------

[](#example)

```

$target = new \DateTime('tomorrow');
$settings = [
    'time' => $request->query('time'),
    'width' => 640,
    'height' => 110,
    'boxColor' => '#000',
    'font' => 'BebasNeue',
    'fontColor' => '#fff',
    'fontSize' => 60,
    'xOffset' => 155,
    'yOffset' => 70,
    'labelOffsets' => "0.5,3,5.2,7.6",
];

$gif = new CountdownTimer($settings, $target);

header('Content-Type', 'image/gif');
header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0');
header('Pragma', 'no-cache');

echo $gif->getAnimation();

```

### Fonts

[](#fonts)

Any font file can be used as the base font for the countdowm timer. To use a custom font reference its absolute path in the settings parameter `font`. *Note: fonts must be uploaded using the `ttf` file extension*.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 78.6% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/48ef2adcffc130aeda08bc85270619627240c6aacfea079abb2a0461cd0c3c07?d=identicon)[joe-pritchard](/maintainers/joe-pritchard)

---

Top Contributors

[![joe-pritchard](https://avatars.githubusercontent.com/u/25373032?v=4)](https://github.com/joe-pritchard "joe-pritchard (11 commits)")[![woolm110](https://avatars.githubusercontent.com/u/3187079?v=4)](https://github.com/woolm110 "woolm110 (3 commits)")

### Embed Badge

![Health badge](/badges/joe-pritchard-email-countdown-timer/health.svg)

```
[![Health](https://phpackages.com/badges/joe-pritchard-email-countdown-timer/health.svg)](https://phpackages.com/packages/joe-pritchard-email-countdown-timer)
```

###  Alternatives

[spatie/ssh

A lightweight package to execute commands over an SSH connection

8322.8M41](/packages/spatie-ssh)[log1x/pagi

A better WordPress pagination.

59105.4k](/packages/log1x-pagi)[kepex/laravel-crud-generator

php artisan command to generate fully working crud with grid paginated server side only by having database tables

10216.7k](/packages/kepex-laravel-crud-generator)

PHPackages © 2026

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