linktoahref / vevent
A Simple VEvent Generator
dev-master
2018-05-09 04:07 UTC
This package is not auto-updated.
Last update: 2025-06-17 10:10:11 UTC
README
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
$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