Giter Site home page Giter Site logo

events4java's Introduction

events4java

Events4java is simple reminder sender for SMTP and Exchange endpoints (with EWS API enabled). For SMTP it uses ICS files in enclosed as attachment. Two possible ways of dispatching are available:

Requirements:

  • JDK 1.6+
  • SMTP or EWS API enabled Exchange server
  • for libraries requirements see pom.xml

Settings

events4java can be loaded with two different ways. Loading from properties file located within class path or with Properties object.

Load settings from file

Library searches for file events4java.properties within class path. Have a look at events4java.properties sample file how it should look like.

Loading from Properties object

Properties properties = new Properties();
properties.put("ExchangeURL", "http://gogo");
E4JConfiguration.setProperties(properties);

Create event object

You can create an all day event or time specific event:

EventMailInfo mailInfo = new EventMailInfo("test@test", "SUBJECT", "EMAILBODY", "FILENAME.ics");
EventDateInfo dateInfo = new AllDayEvent("Christmas", 24, 12, 2015);

Time specific event:

Start time: 2015/12/24 10:00 End time: 2015/12/24 10:30

EventMailInfo mailInfo = new EventMailInfo("test@test", "SUBJECT", "EMAILBODY", "FILENAME.ics");
EventDateInfo dateInfo = new TimeSpecificEvent("Christmas", new DateTime(2015, 12, 24, 10, 0), new DateTime(2015, 12, 24, 10, 30));

How to send ICS file with SMTP

When your EventMailInfo and EventDateInfo are created, you can use synchronous or asynchronous way to send ICS file to the user.

Synchronous call

EventMailInfo mailInfo = new EventMailInfo("test@test", "SUBJECT", "EMAILBODY", "FILENAME.ics");
EventDateInfo dateInfo = new AllDayEvent("Christmas", 24, 12, 2015);
SMTPEventData eventData = new SMTPEventData(mailInfo, dateInfo);
SMTPEventEndpoint endpoint = new SMTPEventEndpoint(eventData);

endpoint.dispatchEvent();

Asynchronous call

EventMailInfo mailInfo = new EventMailInfo("test@test", "SUBJECT", "EMAILBODY", "FILENAME.ics");
EventDateInfo dateInfo = new AllDayEvent("Christmas", 24, 12, 2015);
SMTPEventData eventData = new SMTPEventData(mailInfo, dateInfo);

AsyncRunner asyncRunner = new AsyncRunner(new SMTPEventEndpoint(eventData), new AsyncHandler() {
        @Override
        public void done(EventEndpoint e) {
            System.out.print("OK!");
        }

        @Override
        public void error(EventEndpoint e, Throwable t) {
            System.out.println(t);
        }
});
asyncRunner.start();

Bug reports, feature requests and contact

If you found any bugs, if you have feature requests or any questions, please, either file an issue at GitHub.

License

event4java is published under the MIT license.

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.