Skip to content

Just a simple PHP script to generate a countdown GIF animation inside an email

License

Notifications You must be signed in to change notification settings

MarBie77/EmailCountdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmailCountdown

Just some simple PHP classes to generate a countdown (60 seconds GIF animation) to be used as fake counter in an email

The image itself works with Outlook, but it shows only the first frame of the GIF animation.

Installation

Use Composer to install it

composer require marbie77/emailcountdown

Usage

Create the class, use the options and output the GIF.

$emailCountdown = (new EmailCountdown\CircleCountdown())->setDestinationTime(! empty($_GET['dest_time']) ? $_GET['dest_time'] : null)
    ->setTextColor(! empty($_GET['text_color']) ? $_GET['text_color'] : null)
    ->setBackgroundColor(! empty($_GET['background_color']) ? $_GET['background_color'] : null);

// content type gif
header('Content-Type: image/gif');
// no caching of gif, so it gets reloaded every time
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
echo $emailCountdown->getGIFAnimation();

Examples

To check the examples, first install dependencies with composer install

Then navigate to example.php or example_wallpoet.php

Changelog

2.1.1

  • adding PR for removing deprecation messages from @simoheinonen

2.1.0

  • adding PR for setting max frames from @simoheinonen

2.0.1

  • adding new function to customize shown text and position
  • adding font Wallpoet-Regular to show additional example (example_wallpoet.php)

2.0.0

  • added PHPDocs and new coding standards i.e.
    • removed all underscores from properties and methods
    • using camelCase now
  • includes PR from @igumenov - thank you!

1.0.0

  • Initial version

About

Just a simple PHP script to generate a countdown GIF animation inside an email

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages