2017 © Pedro Peláez
 

library vevent

A Simple VEvent Generator

image

linktoahref/vevent

A Simple VEvent Generator

  • Wednesday, May 9, 2018
  • by linktoahref
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

A Simple VEvent Generator

Installation

composer require linktoahref/vevent

Usage

use LTAH\Generator\VEvent;

$event = VEvent::create('Event Summary or Title', new DateTime('2018-05-10'), new DateTime('2018-05-11'));

$event->addOrganizer('Organizer Name', 'test@mail.com');

$event->addAttendees('Attendee Name', 'foo@bar.com');

echo $event->render();

Send the Event in Mail

If using Laravel you could modify the Mailable class's withSwiftMessage method within the build method, (*1)

$this->markdown('emails.mailable')
        ->with([ params ]);

$this->withSwiftMessage(function ($message) use ($ical, $subject) {
    $message->setBody($event->render(), 'text/calendar; charset="utf-8"; method=REQUEST');
    $message->addPart($this->buildView()['html']->toHtml(), 'text/html');
});

return 
    $this->subject($subject)
        ->attachData($event->render(), 'meeting.ics', [
            'mime' => 'text/calendar; charset="utf-8"; method=REQUEST',
        ]);

This would render the event with styling in gmail and outlook, (*2)

The Versions

09/05 2018

dev-master

9999999-dev

A Simple VEvent Generator

  Sources   Download

MIT

by Rahul Chandrasekharan