GithubHelp home page GithubHelp logo

kingsleyxie / birthdayemail Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 41.33 MB

:cake: Automatically send birthday card emails everyday

PHP 100.00%
birthday-card birthday-emails image-generation email-sender font-property

birthdayemail's Introduction

BirthdayEmail:cake:

This is a naive tool for organizations or associations to automatically send birthday emails:email: every day once connected with the member management system, more details or ideas can be found in my blog if you are interested.

Usage

Write configurations:pencil: in Tool/Config.php according to samples provided inside Tool/Config.example.php.

Run test file via command line to check whether text functions work properly:

$ php CLITest.php

Besides text related test results on screen, you should also see images/ directory:file_folder: is created, in which all the cards are generated using test names, with or without reference lines.

The alternative font will be chosen if there is text which the default font does not support.

Be aware that the database, email, and log functions are not tested now, you should test them via the actual working command shown below with πŸ”§TEST CONFIGURATIONS:

$ php index.php

Till now, if all seems to be fine, just change configurations to the production environment, and set the command as a timed task to crontab, for example:

0 11 * * * cd /path/to/directory/ && php index.php

In this example, the tool will automatically run at 11:00 πŸ•š every morning, generate birthday card and send email for each member that is celebrating a birthday.

If any error occurs, each email address in Config::$mail['error']['admin'] will receive an alert.

Notes

It is recommended NOT to deploy on the www-rootπŸ”— directory on the web server since the operation runs under command line interface.

More significantly, there are directories that may contain privacy information:

  • images/: All the birthday cards, every subdirectory is named by date
  • logs/
    • data.log: Members' data from the database
    • mail.log: Name and destination of successfully sent emails
    • fail.log: Name, destination and error messages of failure operations

⚠️ So do remember to make accurate access control if it has to be deployed on the web folder, and rename index.php to some random string will be even better.

Dependencies

Special thanks to the dependencies:heavy_plus_sign: which helped a lot during the development:

birthdayemail's People

Contributors

kingsleyxie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.